Thanks for the video, not quite get the nested for loop must use int2array.GetLength(1) int[,] int2darry = new int [,] { {1,2,3}, {4,5,6}, {7,8,9} }; Console.WriteLine(int2darry.GetLength(0)); Console.WriteLine(int2darry.GetLength(1)); The running result 3 3
@alexmelbourne2 жыл бұрын
Sorry I answer myself int[,] int2darry = new int [,] { {1,2,3}, {4,5,6} }; Console.WriteLine(int2darry.GetLength(0)); Console.WriteLine(int2darry.GetLength(1)); Getlength(0) = 3 columns Getlength(1) = 2 rows