c# declare 2d array with size code example
Example 1: c# length 2d array
int rowsOrHeight = ary.GetLength(0);
int colsOrWidth = ary.GetLength(1);
Example 2: how to declare 2d array in c#
// Two-dimensional array.
int[,] array2D = new int[,] { { 1, 2 }, { 3, 4 }, { 5, 6 }, { 7, 8 } };