Row-major order : If the array is declared as a[m][n]
where m is the number of rows and n is the number of columns, the element address of the array stored in the row- a[i][j]
major order is calculated as:
Address(a[i][j]) = B. A. + (i * n + j) * size
Column-major order : If the array is declared as a[m][n]
where m is the number of rows and n is the number of columns, the addresses of the array elements stored in the column- a[i][j]
major order are calculated as:
Address(a[i][j]) = ((j*m)+i)*Size + BA