OOPS
August 29, 2024OOPS
August 29, 2024OOPS
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[0][0][0]+w(b*c*s+c*r+t) | |
&A[0][0][0]+w(b*c*r*+c*s+t)
| |
&A[0][0][0]+w(a*b*r*+c*s+t)
| |
&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)
Subscribe
Login
0 Comments