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 SalmaTrader, 07-07-2026, 10:26 PM
            0 responses
            35 views
            0 likes
            Last Post SalmaTrader  
            Started by CarlTrading, 07-05-2026, 01:16 PM
            0 responses
            20 views
            0 likes
            Last Post CarlTrading  
            Started by CaptainJack, 06-17-2026, 10:32 AM
            0 responses
            12 views
            0 likes
            Last Post CaptainJack  
            Started by kinfxhk, 06-17-2026, 04:15 AM
            0 responses
            18 views
            0 likes
            Last Post kinfxhk
            by kinfxhk
             
            Started by kinfxhk, 06-17-2026, 04:06 AM
            0 responses
            20 views
            0 likes
            Last Post kinfxhk
            by kinfxhk
             
            Working...
            X