Given a 3-dimensional array C[3][4][5] stored in row-major order, with each element
Given a 3-dimensional array C[3][4][5] stored in row-major order, with each element
occupying 1 byte, and the base address 3000, what is the address of C[2][3][4]?
Show answerHide answer
Correct answer: (B) 3059
Explanation
Offset = i × (4 × 5) + j × 5 + k = 2 × 20 + 3 × 5 + 4 = 59, so the address is 3000 + 59 = 3059.