Course Content
History of C Language
0/2
Basic Structure of C Program
0/1
Types of Errors
0/1
Language Fundamentals
0/1
Data Types and Modifiers
0/1
Programming with C Language
About Lesson

In principle, there is no limit to the number of subscripts (or dimensions) an array can have. Arrays with more than one dimension are called multi- dimensional arrays.

The first number in brackets is the number of rows, the second number in brackets is the number of columns. So, the upper left corner of any grid would be element [0][0]. The element to its right would be [0][1], and so on.

Initialization of 2-dimensional arrays:

If you have an m x n array, it will have m * n elements and will require m*n*elementsize bytes of storage. To allocate storage for an array you must reserve this amount of memory. The elements of a two-dimensional array are stored row wise.

int table [ 2 ] [ 5 ] = {{ 1,2,3,4,5 },{6,7,8,9.10}};

You cannot copy content of this page