Copyright ©2004 Pearson Addison-Wesley. All rights reserved.
2D array in address space(1)
How to store a multi-dimensional array into a one-dimensional memory space.
Row major ordering assigns successive elements, moving across the rows and then down the columns, to successive memory locations.
Address of a[row][col] = Base_Address + (row * row_size + col) Base_Address is the address of the first element of the array (A in this case).
char *base = &A;
Referring A[i][j] is same as referring *(base+4*i+j);