

These are stored in the memory as given below.
1) Row-Major order Implementation
2) Column-Major order Implementation
In Row-Major Implementation of the arrays, the arrays are stored in the memory in terms of the row design, i.e. first the first row of the array is stored in the memory then second, and so on.
Suppose we have an array named arr having 3 rows and 3 columns then it can be stored in the memory in the following manner :
int arr[3][3];
Thus an array of 3*3 can be declared as follows :
arr[3][3] = { 1, 2, 3,
4, 5, 6,
7, 8, 9 };
and it will be represented in the memory with row-major implementation as follows :
In Column-Major Implementation of the arrays, the arrays are stored in the memory in the term of the column design, i.e. the first column of the array is stored in the memory than the second, and so on. By taking the above eg. we can show it as follows :
arr[3][3] = { 1, 2, 3,
4, 5, 6,
7, 8, 9 };
and it will be represented in the memory with column-major implementation as follows :
Two-dimensional arrays of variable length
An array consisting of two subscripts is known as a two-dimensional array. These are often known as an array of the array. In two-dimensional arrays, the array is divided into rows and columns,.
These are well suited to handle the table of data. In a 2-D array, we can declare an array as :
Declaration:-
Syntax: data_type array_name[row_size][column_size];
Ex: int arr[3][3] ;
Where first index value shows the number of the rows and the second index value shows the no. of the columns in the array.
These are stored in the memory as given below.
Initialization:-
To initialize values for variable-length arrays we can use scanf statement and loop constructs.
Ex:-
for ( i=0 ; i<3; i++ )
for( j=0;j<3;j++ )
scanf( “ %d ”,&arr[i][j] );
Recommended Questions
Useful Files
Users Joined





These are stored in the memory as given below.
1) Row-Major order Implementation
2) Column-Major order Implementation
In Row-Major Implementation of the arrays, the arrays are stored in the memory in terms of the row design, i.e. first the first row of the array is stored in the memory then second, and so on.
Suppose we have an array named arr having 3 rows and 3 columns then it can be stored in the memory in the following manner :
int arr[3][3];
Thus an array of 3*3 can be declared as follows :
arr[3][3] = { 1, 2, 3,
4, 5, 6,
7, 8, 9 };
and it will be represented in the memory with row-major implementation as follows :
In Column-Major Implementation of the arrays, the arrays are stored in the memory in the term of the column design, i.e. the first column of the array is stored in the memory than the second, and so on. By taking the above eg. we can show it as follows :
arr[3][3] = { 1, 2, 3,
4, 5, 6,
7, 8, 9 };
and it will be represented in the memory with column-major implementation as follows :
Two-dimensional arrays of variable length
An array consisting of two subscripts is known as a two-dimensional array. These are often known as an array of the array. In two-dimensional arrays, the array is divided into rows and columns,.
These are well suited to handle the table of data. In a 2-D array, we can declare an array as :
Declaration:-
Syntax: data_type array_name[row_size][column_size];
Ex: int arr[3][3] ;
Where first index value shows the number of the rows and the second index value shows the no. of the columns in the array.
These are stored in the memory as given below.
Initialization:-
To initialize values for variable-length arrays we can use scanf statement and loop constructs.
Ex:-
for ( i=0 ; i<3; i++ )
for( j=0;j<3;j++ )
scanf( “ %d ”,&arr[i][j] );

