Tuesday, 27 March 2012

Multi-Dimensional Arrays




 C allows arrays with more than two dimension, to the limit depending on the compiler.
 The general form of a multidimensional array is

 type array_name[s1][s2][s3]....[sn];

The total number of elements in any dimension of arrays is the product of all sizes included in the declaration. So it will be s1*s2*s3*....*sn.
          Ex,
                   int data[3][5][10];
                   Here, data is the three dimensional array and it contain 150 elements.

Posted By : Ruchita Pandya

No comments:

Post a Comment