declaration of a simple 3d int array;
int value[x][y][z];
example: int number[2][5][8];
and you might need loops to access the array elements.
for( int i = 0; i < 2; i++ )
{
for( int j = 0; j < 5; j++ )
{
for( int k = 0; k < 8; k++ )
number[j][k] = 9
}
}
this will initialise all the elements of the array to "9".
here is a little program to illustrate all this:
#include <iostream.h>
void main()
{
int number[2][5][8];
int i, j, k;
for( i = 0; i < 2; i++ )
{
for( j = 0; j < 5; j++ )
{
for( k = 0; k < 8; k++ )
number[j][k] = 9;
}
}
// puts all the elements of the array on the screen
for( i = 0; i < 2; i++ )
{
for( j = 0; j < 5; j++ )
{
for( k = 0; k < 8; k++ )
cout<<"number["<<i<<"]["<<j<<"]["<<k<<"] = "<<number[j][k]<<endl;
}
}
}