
136 Data Structures Using C
3.4.2 Physical Address Computation of Elements of Two-dimensional Arrays
Let us reconsider the two-dimensional array called TAB[2][3] as shown in Figure 3.29.
The array called ‘TAB’ has two rows and three columns. It has been stored in physical memory at a
starting address ‘100’. The address map is given below:
The address of 1st row, 1st col 5 100
1st row, 2nd col 5 100 + 1
1st row, 3rd col 5 100 + 2
_
_
2nd row, 3rd col 5 100 + 5
We know that in two-dimensional array called
TAB, for every row, there are three columns. Thus,
for an element of Ith row the starting address becomes: Base + (I 2 1)