Array of array is called multi dimensional array. general syntax of declaring multidimensional array as follow
for example :-
here a is an array of two dimension. To understand multidimensional array in simple way we can think of this way.
above array A is a two dimensional array which is combination of three single dimensional array A, A and A which are array of 2 elements. We can also understand that a two dimensional array is an collection of various rows and column.
above exmaple will declare 3 rows and two column.
A A A
Array array array
array–2 array – 2 array – 2
intialisation of multi dimentional array:-
C provides various way of initialising multidimentional array .
Accessing an element in two dimentional array:-
an element in an array are accessed by combination of row index and column index. combination of row index and column index tells the exact positon of element in array.
for example to access the 2nd element from 1st row of array c we can do it by following way
Example programm of two dimentional array:-
printf(“print of above array\n”);
after compiling and executing below program we will get below output
print of above array