...
OOPS
August 29, 2024
OOPS
August 29, 2024
OOPS
August 29, 2024
OOPS
August 29, 2024

OOPS

Question 36
A three dimensional array in C++ is declared as int A[a][b][c].consider that array elements are stored in row major order and indexing begin from 0.Here the address of an item at the location A[r][s][t] computed in terms of word length w of an integer is

A
&A[0][0][0]+w(b*c*s+c*r+t)

B
&A[0][0][0]+w(b*c*r*+c*s+t)
C
&A[0][0][0]+w(a*b*r*+c*s+t)
D
&A[0][0][0]+w(a*b*s+c*r+t)
Question 36 Explanation: 
To compute the address of an item at the location A[r][s][t] in a three-dimensional array stored in row-major order as follows

&A[0][0][0] + w * (b * c * r + c * s + t)

Correct Answer: B
Question 36 Explanation: 
To compute the address of an item at the location A[r][s][t] in a three-dimensional array stored in row-major order as follows

&A[0][0][0] + w * (b * c * r + c * s + t)

0 0 votes
Article Rating
Subscribe
Notify of
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x
error: Alert: Content selection is disabled!!