Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Array

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Array

    Hi!
    I have declared an array as followed:

    double ArrayClose[][20].

    Even before compiling, I am receiving an error message: ";" expected.
    Am I mistaking how to declare an array?

    Best regard

    #2
    Hello, thanks for your post.

    The line is ending with a '.' All C# statements end with a ';'

    Please let me know if I can assist any further.

    Comment


      #3
      MAny thanks Chrisl for your reply.
      I have the ";" at the end of the line. The problem still remains.

      Comment


        #4
        Correct my please if I am mistaking.

        Are the following exact?

        private double[,] ArrayClose;
        ArrayClose = new double[0, 20];

        Comment


          #5
          Hello, thanks for your reply.

          An array size specifier should not be 0. Think of this as new double[# of rows, # of columns]

          I found this publicly available guide on initializing multi dimensional arrays here:
          https://www.tutorialspoint.com/cshar...nal_arrays.htm

          A List<List> might also be easier as well because you don't have to manage the memory manually:


          Kind regards,
          -ChrisL

          Comment


            #6
            Many thanks Chris,

            valuable links!
            Great!

            Thanks again!

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Geovanny Suaza, 02-11-2026, 06:32 PM
            0 responses
            607 views
            0 likes
            Last Post Geovanny Suaza  
            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
            0 responses
            353 views
            1 like
            Last Post Geovanny Suaza  
            Started by Mindset, 02-09-2026, 11:44 AM
            0 responses
            105 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by Geovanny Suaza, 02-02-2026, 12:30 PM
            0 responses
            560 views
            1 like
            Last Post Geovanny Suaza  
            Started by RFrosty, 01-28-2026, 06:49 PM
            0 responses
            561 views
            1 like
            Last Post RFrosty
            by RFrosty
             
            Working...
            X