Sunday, 13 July 2014

MULTI- DIMENSIONAL ARRAYS

MULTI- DIMENSIONAL ARRAYS

  • Multi dimensional arrays are same as one- dimensional array. The only difference is that we have more than one dimension to our stack of data.
  • Observe one thing that if you are using a 1D array, you would need a single for loop and for a nD array, you would need n for loops

SYNTAX :-

storage_class data_type array_name [dimension][dimension ]....[dimension ];

TWO- DIMENSIONAL ARRAY

SYNTAX :-

storage_class data_type array_name [ ROW ] [COLUMN ];

Eg-
      int student [10] [5];     

NOTE----   5*10= 50 characters in array student