Background

All the characteristics that are mentioned for 1-Dimensional array hold good for multi-dimensional arrays too. Apart from that

Declaration of a multi-dimension array as a argument to a function, must include explicit size declarations in all of the subscript positions except for the first, which is an option.

Memory Mapping

In C/C++, memory mapping for multi-dimensional arrays, is done using Row Major ordering. It means, memory is allocated for successive elements by incrementing the rightmost index until it reaches the end of the current Row.

2-Dimensional Arrays

A 2-Dimensional Array is nothing but Array of 1-Dimensional Array and is represented with two subscripts as below:

2-Dimensional array can be imagined as a 2-D table made of elements of same data type as in below picture:

Memory Mapping in 2-D Array

For Example if we take int array[2][3];

Here array will be considered as base address and successive address for the elements will be allocated at sizeOfElement*offset in Row Major Ordering. And here if we take the sizeOfElement as 1 then memory mapping for array[2][3] looks as below:

Like in 1-D array, if some of the indices in an interger 2-D array are not given initilizers, then by default they will be initilized with 0. Also if we assign 2-D Array with {}, it would initialize all it's elements with 0 value.

2-D Array of characters

Like in 1-D Arrays, 2-D Arrays of strings can be initilized in two ways as below:

char array[3][4] = {
'd','o','g'
'c','a','t',
'r','a','t'
}

or

char array[3][4] = {"dog", "cat", "rat"};

As said above for integer arrays, if initilizers are not given for some elements in character arrays, they will be initilized with NULL characters.

Imagine a 2-D array as shown in below example picture and then put the elements at the respective indices in the picture. This helps to read/recognise any element of the array at a given indcies.

3-Dimensional Arrays

Multi Dimensional Arrays are not limited to 2-D alone. They can be of as many indices as needed. But developer must be careful here, as the memory that consume increases with proportional to the dimension.

A 3-Dimensional Array can be said as Array of 2-Dimensional Arrays and is represented with three subscripts as below:

data_typeOfArray arrayName [firstDimension] [secondDimension] [thirdDimension]
whereas firstDiemnsion is also called as depthSize here.

For Example:

int arry[2][3][4]; can be called as
2 Arrays of 2-Dimensional Arrays of size 3X4 !!

Memory Mapping in 3-D Array

If we take int array[2][3][4];

And array will be considered as base address and successive address for the elements will be allocated at sizeOfElement*offset in Row Major Ordering as below: