Array Memory Representation
Array Memory Representation
One-Dimensional Arrays
element 4
Start
here
Some array terminology
mark[2] = 32;
Note that "element" may refer to either a single indexed
variable in the array or the value of a single indexed variable.
Memory representation
• Address of A[I]=
Base Address + size * (I - Lower Bound)
Here,
Base address=1000, I=4, Lower
Bound=0
Size of Int=2
Marks[4]=1000+ 2*(4-0) = 1008
Question
• Base address=4000
• I=15,Lower Bound=10
• Size-2
• Address of A[I]=B.A + size*(I-
Lower bound)
• Address of A[15]=4000+2*(15-10)
=4010
Thank You