Memory Representation
- 2-D arrays are Stored in contiguous memory location row wise.
- 3 X 3 Array is shown below in the first Diagram.
- Consider 3×3 Array is stored in Contiguous memory location which starts from 4000 .
- Array element a[0][0] will be stored at address 4000 again a[0][1] will be stored to next memory location i.e Elements stored row-wise
- After Elements of First Row are stored in appropriate memory location , elements of next row get their corresponding mem. locations.

- This is integer array so each element requires 2 bytes of memory.
Basic Memory Address Calculation :
a[0][1] = a[0][0] + Size of Data Type
Element | Memory Location |
---|
a[0][0] | 4000 |
a[0][1] | 4002 |
a[0][2] | 4004 |
a[1][0] | 4006 |
a[1][1] | 4008 |
a[1][2] | 4010 |
a[2][0] | 4012 |
a[2][1] | 4014 |
a[2][2] | 4016 |
