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 CarlTrading, 03-31-2026, 09:41 PM
            1 response
            77 views
            1 like
            Last Post NinjaTrader_ChelseaB  
            Started by CarlTrading, 04-01-2026, 02:41 AM
            0 responses
            40 views
            0 likes
            Last Post CarlTrading  
            Started by CaptainJack, 03-31-2026, 11:44 PM
            0 responses
            63 views
            2 likes
            Last Post CaptainJack  
            Started by CarlTrading, 03-30-2026, 11:51 AM
            0 responses
            63 views
            0 likes
            Last Post CarlTrading  
            Started by CarlTrading, 03-30-2026, 11:48 AM
            0 responses
            53 views
            0 likes
            Last Post CarlTrading  
            Working...
            X