Briefly describe kinds of multidimensional arrays.
- Multidimensional arrays are just like a table structure with rows and column.
- It is also called as Matrix.
Syntax:<datatype>
[rowsize] [column]; Example:int arr[3] [3]; // An array with 3 rows and 3 columns
or
int arr[3] [3] ={5,10,15,20}; //Two dimensional array with hard-coded values
Multidimensional arrays can be:1. Rectangular arrays
2. Jagged arrays
1. Rectangular arrays:- A rectangular array has the same number of columns in each row.
- These multidimensional arrays have all the sub-arrays with a particular dimension of the same length.
- You need to use a single set of square brackets for rectangular arrays.
2. Jagged arrays:- A Jagged array can contain different number of columns in each row.
- These multidimensional arrays have each sub-array as independent arrays of different lengths.
- With these you need to use a separate set of square brackets for each dimension of the array.