Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Is it possible to create an array of a user class?

Is it possible to create an array of a user class?

Scheduled Pinned Locked Moved C#
questioncssdata-structureshelp
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    signbit
    wrote on last edited by
    #1

    Hello, (call it my laziness or my haste that I am post a question straight here instead of consulting the reference books) I have a point class in my project called FoxPoint, can I make a 2D array like this: FoxPoint[,] strokes = new FoxPoint[4, 10]; It's giving me strange errors:

    Error 1 Inconsistent accessibility: parameter type FOX_CSharp.FoxPoint[*,*]' is less accessible than method 'FOX_CSharp.ConComp2Form.DrawBoundries(FOX_CSharp.FoxPoint[*,*])' C:\...\FOX_CSharp - Integrated - Aug 05 06\FOX_CSharp\ConComp2Form.cs 195 21 FOX_CSharp

    - A programmer's national anthem; "AAAAAHHHHH!!!!"

    L P 2 Replies Last reply
    0
    • S signbit

      Hello, (call it my laziness or my haste that I am post a question straight here instead of consulting the reference books) I have a point class in my project called FoxPoint, can I make a 2D array like this: FoxPoint[,] strokes = new FoxPoint[4, 10]; It's giving me strange errors:

      Error 1 Inconsistent accessibility: parameter type FOX_CSharp.FoxPoint[*,*]' is less accessible than method 'FOX_CSharp.ConComp2Form.DrawBoundries(FOX_CSharp.FoxPoint[*,*])' C:\...\FOX_CSharp - Integrated - Aug 05 06\FOX_CSharp\ConComp2Form.cs 195 21 FOX_CSharp

      - A programmer's national anthem; "AAAAAHHHHH!!!!"

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      You have something wrong with "public" and "private". Change all to private or change all to public to solve it. See this: http://www.dotnet247.com/247reference/msgs/7/38448.aspx

      S 1 Reply Last reply
      0
      • L Lost User

        You have something wrong with "public" and "private". Change all to private or change all to public to solve it. See this: http://www.dotnet247.com/247reference/msgs/7/38448.aspx

        S Offline
        S Offline
        signbit
        wrote on last edited by
        #3

        I thought the same when I first looked at the error message, but the funtions is public. Do I need to put 'public' before 'class' as well?

        - A programmer's national anthem; "AAAAAHHHHH!!!!"

        1 Reply Last reply
        0
        • S signbit

          Hello, (call it my laziness or my haste that I am post a question straight here instead of consulting the reference books) I have a point class in my project called FoxPoint, can I make a 2D array like this: FoxPoint[,] strokes = new FoxPoint[4, 10]; It's giving me strange errors:

          Error 1 Inconsistent accessibility: parameter type FOX_CSharp.FoxPoint[*,*]' is less accessible than method 'FOX_CSharp.ConComp2Form.DrawBoundries(FOX_CSharp.FoxPoint[*,*])' C:\...\FOX_CSharp - Integrated - Aug 05 06\FOX_CSharp\ConComp2Form.cs 195 21 FOX_CSharp

          - A programmer's national anthem; "AAAAAHHHHH!!!!"

          P Offline
          P Offline
          peterchen
          wrote on last edited by
          #4

          DrawBoundries is public, but takes an argument FOX_CSharp.FoxPoint[*,*] that is less accessible (e.g. private). To call the function, you actually need a FoxPoint, so the funciton can be called only as if it were private. You need to make FoxPoint public, too.


          We are a big screwed up dysfunctional psychotic happy family - some more screwed up, others more happy, but everybody's psychotic joint venture definition of CP
          Tree in C# || Fold With Us! || sighist

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups