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
  • 115,751
  • 26
  • 228
  • 437

1 Answers1

0

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

Sami Kuhmonen
  • 30,146
  • 9
  • 61
  • 74