ArraySize Function returns falls value

 

I expected that ArraySize returns 6, but it returns 0! Why?

void OnStart()
  {
   int myArray[3][2] = {{10,20}, {30,40}, {50,60}};
   PrintArray(myArray);
  }

void PrintArray(int &inputArray[][])
  {
   int arraySize = ArraySize(inputArray);
   Alert(arraySize);
  }

 
FBOLST:

I expected that ArraySize returns 6, but it returns 0! Why?


void PrintArray(int &inputArray[][])
  {
   int arraySize = ArraySize(inputArray);
   Alert(arraySize);
  }

Because array size is not able to deal with 2 dimensions dynamic array.

Use

void PrintArray(int &inputArray[][2])

However it's weird it doesn't give any error.

 
I copied and pasted your code. Saved and compiled it. Then I ran it on a chart. I got 6 on the alert. Not sure where you see 0.
 
Stephen Fabrico #:
I copied and pasted your code. Saved and compiled it. Then I ran it on a chart. I got 6 on the alert. Not sure where you see 0.
Interesting, it gives 0 while debugging.
 
   Alert("Build:",TerminalInfoInteger(TERMINAL_BUILD)," ",MQLInfoInteger(MQL_DEBUG) ? " DEBUG" : " NORMAL", " mode. Size:", arraySize," Error:",_LastError);