Multidimensional Arrays:


C allows arrays of three or more dimensions. The exact limit is determined by the compiler. The general syntax of specifying a multidimensional array is:


Here the type corresponds to the data type of the array, the array_name is the name of the array and rest are the size specifications enclosed in square brackets. For example,
                        int a[3][4][5];
It represents an array a of integer type 3*4*5=60 elements in total. The three size specifications tells that it is a 3-dimensional array.
The multidimensional arrays are initialized in the same manner as two-dimensional arrays. 

Previous                                                                                    Next


Powered by Blogger.