Aspire's Library

A Place for Latest Exam wise Questions, Videos, Previous Year Papers,
Study Stuff for MCA Examinations - NIMCET

Previous Year Question (PYQs)



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





Solution

For a 3D array $A[a][b][c]$ stored in row major order:


Address of $A[r][s][t]$ is


Base address + $w[(r \times b \times c) + (s \times c) + t]$


So,


Address = $ A[0][0][0] + w(bcr + c*s + t)$



Online Test Series,
Information About Examination,
Syllabus, Notification
and More.

Click Here to
View More


Online Test Series,
Information About Examination,
Syllabus, Notification
and More.

Click Here to
View More

Ask Your Question or Put Your Review.

loading...