edited by
3,742 views
0 votes
0 votes

My question is : in the row [8][-8] to [8][5] will be 5-(-8)+1 = 14 elements , right ? so , it should be 1060 then considering 4 Byte is one element.

I know , this is pretty basic question. But , still got me wrong :)

edited by

2 Answers

6 votes
6 votes
Row major order  = base address + [ (Row - smalest index) $\times$ Total column + (column - smallest index of column) ] $\times$ size

                         = 800 + [ (8 - 5) $\times$ 17 + ( 5 - (-8)) ] $\times$ 4

                        =  800 + [51 + 13 ] $\times$ 4

                        = 800 + 256 = 1056
2 votes
2 votes

 

 

 

Just transform the array

 

Related questions

0 votes
0 votes
1 answer
2
viral8702 asked Apr 29, 2022
446 views
A frame buffer array is addressed in row major order for a monitor with pixel locations starting from (0,0) and ending with (100,100). What is address of the pixel(6,10)?...
6 votes
6 votes
0 answers
3
V pandey asked Oct 8, 2022
3,017 views
Consider a multi-dimensional array A [90][30]40] with base address start at 1000, calculate the address of A[10][20][3] in row major order and column major order. Assume ...
0 votes
0 votes
2 answers
4
srestha asked Oct 29, 2017
899 views
An array A[10][20] starts at decimal address 1000. Each element of array occupies 1 B and array is stored in row major order. Compute address of A[5][6]just give the outp...