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 charlesugo_1, 05-26-2026, 05:03 PM
            0 responses
            68 views
            0 likes
            Last Post charlesugo_1  
            Started by DannyP96, 05-18-2026, 02:38 PM
            1 response
            151 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Started by CarlTrading, 05-11-2026, 05:56 AM
            0 responses
            162 views
            0 likes
            Last Post CarlTrading  
            Started by CarlTrading, 05-10-2026, 08:12 PM
            0 responses
            100 views
            0 likes
            Last Post CarlTrading  
            Started by Hwop38, 05-04-2026, 07:02 PM
            0 responses
            288 views
            0 likes
            Last Post Hwop38
            by Hwop38
             
            Working...
            X