Question: Take this general formula: addr ( matrix [ i , j ] ) = p + ( i ps ) + ( j es )

Take this general formula: addr(matrix[i,j])=p+(ips)+(jes)
for a 0-origin array where es = element size, ps = pointer size, matrix is the name of array, I is row and j is column to be accessed, and the base address of the array is p. Modify it, but allow for the lower bound of each dimension to be other than 0-origin. So instead of array[0..up1; 0..up2], the bounds would be array[lb1..up1;lb2..up2].
from there, assuming a matrix declaration var aMatrix : array [4...11; 3...12] and p =2000, ps =2, es =4, get the address of aMatrix [6,7]

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!