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 argusthome, Yesterday, 10:06 AM
            0 responses
            20 views
            0 likes
            Last Post argusthome  
            Started by NabilKhattabi, 03-06-2026, 11:18 AM
            0 responses
            18 views
            0 likes
            Last Post NabilKhattabi  
            Started by Deep42, 03-06-2026, 12:28 AM
            0 responses
            14 views
            0 likes
            Last Post Deep42
            by Deep42
             
            Started by TheRealMorford, 03-05-2026, 06:15 PM
            0 responses
            9 views
            0 likes
            Last Post TheRealMorford  
            Started by Mindset, 02-28-2026, 06:16 AM
            0 responses
            40 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Working...
            X