Array address calculation 2019

A matrix ARR[ – 4…6, 3….8] is stored in the memory with each element requiring 4 bytes of storage. If the base address is 1430, find the address of ARR[3][6] when the matrix is stored in Row Major Wise.

Row Major Wise: ARR[i][j] = BA + W [ (i – lr )* col + (j – lc]
Putting the values: = 1430 + 4[ (3 –(-4)) * 6 + (6-3)]
= 1430 + 4[ 42 + 3]
= 1430 + 180
= 1610

This entry was posted in address. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *