two-dimensional array: it represents a tabular data. There are rows and columns. The same as the array: All data is of the same type, and the number of stores is fixed. the creation of a two-dimensional array of one or two-only arrays is characterized by rows and columns. The type of the element [,] The name of the array =new the type of the element [number of rows, number of columns];int[,] arr=new int[4, 3]; represents a table structure that declares a specified number of rows, each row has a specified number of columns. Number of elements in a two-dimensional array: number of rows * ColumnsIi. assigning values to elements in a two-dimensional arraythe elements in a two-dimensional array must be determined by the row and column two coordinates. Determine the number of columns in the first row of this element. the row and column coordinates in a two-dimensional array start at 0. You can navigate to the specified element by writing the upstream and column coordinates in the indexer. arr[Line coordinates, column coordinate]= value;third, the value:values are still taken by row coordinates and column coordinates. A one-dimensional array represents a line. Make sure a point on the line is just one coordinate. A two-dimensional array represents a polygon. To determine a point on a face 2 coordinates Four, TraverseThe length property represents the number of elements in the array, while the length in the two-dimensional array refers to the row * columnA, using foreach can be easily and quickly traversed. B, the GetLength () of the array can get the length of the specified latitude. Pass in 0 to get the number of rows. incoming 1 can get the number of columns for (int i=0;i<arr. GetLength (0); i++){for (int j=0;j<arr. GetLength (1); j + +) {Console.Write (Arr[i,j]); }Console.WriteLine ();}The rank property of the array can be used to get the dimensions of the array PS: three-dimensional arrayint[,,] arr=new int[3, 5, 4];
Two-dimensional arrays