The GetLength method in C# is used to determine the size of a multidimensional array. The syntax for using GetLength with a 3-dimensional array would be:
int[,,] arrayName = new int[x, y, z]; Console.WriteLine(arrayName.GetLength(0)); // prints the length in x dimension Console.WriteLine(arrayName.GetLength(1)); // prints the length in y dimension Console.WriteLine(arrayName.GetLength(2)); // prints the length in z dimension
In this example, we create a 3-dimensional array called arrayName with dimensions x, y, and z. We then call the GetLength method on each dimension of the array to print their respective sizes.
This code example is using the C# standard library.
C# (CSharp) int[,,].GetLength - 20 examples found. These are the top rated real world C# (CSharp) examples of int[,,].GetLength extracted from open source projects. You can rate examples to help us improve the quality of examples.