+ 1

multidimensional array / why does it says "array doesnt have that many of arrays inside it" even though it is 0 index based

.GetLength() is 0 index based it should work int[,] num = {{1,2,3},{4,5,6},{7,8,9}}; Console.Write( num.GetLength(2)); // it should give the length of the 3rd array but it doesnt

6th Jun 2022, 3:58 AM
Mohammad _io_
1 Antwort
0
That id an array of 2 dimmensions..so the ..GetLength work for index 0 and 1..
6th Jun 2022, 5:25 AM
Cristian Baeza Jimenez
Cristian Baeza Jimenez - avatar