Multi-Dimensional Array



Multi dimensional arrays are defined in very similar way are defining the one dimensional arrays except that a separately pair of square brackets is required.

Thus, a two dimensional array will required two pairs of square brackets; three dimensional array will require three pairs of square brackets. A multi dimensional array can be created by using the syntax.

E.g.: Int a [3] [5];

Where data type is data type of array and array name is the name given to array.

E.g.: Int a [1][2];

The two dimensions A is of int data type having two subscribe points each of capacity three.

In other sense is one array having two rows & columns.

Character array are used to stored strings. Whenever the string is used into a character array its end is marked with a special character ‘\0’.

E.g.: char a [10];

1050    1051    1052    1053    1054   1055-------------------------1059

E.g.: scanf (“%s”, a);

A string can be read by using a function scanf (%s)

E.g.: printf (“%s”, a);

A string can be displayed by using a function printf ()