How does three dimensional array works?

Showing Answers 1 - 3 of 3 Answers


  • Oct 17th, 2006

A 3-D array can be considered as an array of a 2-Dimensional array and thats very simple to understand. Consider an example ,say we have an array declaration int A[2][3][2],thats a 3-D array.We need to develop a decoding scheme to interpret the meaning of such declarations.

Read it like this: int (A[2])[3][2] (Note the braces) .'A' is an array of 2 elements and these 2 elements are not simple integers as it would have been in the case if 'A' was a 1-D array.Here ,the two elements that 'A' is made up of a 2-D array of dimensions 3*2 .i.e A 3-D array in this case is nothing but a collection of two 2-D arrays in our example.

in other words ,we say that 'A' is made of 2 pages ,3 rows and 2 columns each,in all we have total=2*3*2=12 elements in our array

but this is just a logical explanation ,physically an array be it any dimensional ,is always stored sequentially as memory is Linear.


  • Nov 13th, 2006

let us take an example



int a[2][2][2];

int i,j,k;





           printf("i= %dnj=%dnk=%dnnn ",i,j,k);

              printf("enter the value to store at the specified postionn");





if u compile and execute the above prg it shows the values of the variables i,j,k  and where it stores.  by this u can make that how the three dimensional array works


  • Nov 18th, 2006

a 3-d array is collection 2-d arrays as rows.

ex: a[2][3][4] means 'a' contains two 2-d arrays of each size [3][4].

first subscript 2 indicates that 'a' contains two arrays which have 3-rows and 4-coloumns.

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

Answer Question

Click here to Login / Register your free account

Send   Reset


Related Answered Questions


Related Open Questions