2

I have defined two three dimensional arrays as:

int[, ,] Link_k = new int[length1, length1, length1];
int[][][] Link_k2 = new int[length1][][];

where length1 is variable and could be any integer number.

Now in some point of my code I need to know the size of first index of both arrays. Does anyone know how I could to get?

jonrsharpe
  • 107,083
  • 22
  • 201
  • 376

1 Answers1

0

You can use the GetLength(int dimension) method to determine the size of whatever dimension you want.

Sami Kuhmonen
  • 28,738
  • 9
  • 60
  • 71