Addressing an element of an arrayat a particular index for one Dimensional array
In this we have to find the address of an element at a particular subscript.
Let's suppose an exampleA[1300..........1900] and the base address of an array is given 1187 , find all list of element is 2 bytes and we have to find the address of A[1708]
Solution
In this we have given with
B=1187 , Lb=1300 , W=2, I=1708
so
A[I]= B+W*(I-Lb)
A[1708]=1187+2(1708-1187)
=1187+2(521)
=1187+1042
A[1708]= 2229
08- Addressing an Element in 1-D-Array - C Programming Language
CLICK HERE TO Download This PDF NOTES