I think what you want to do is create the array like this:

Qt Code:
  1. int ***array;
  2.  
  3. array = (int***) malloc( sizeof( int** ) * X_SIZE );
  4. for( int i = 0 ; i < X_SIZE ; i++ )
  5. {
  6. array[i] = (int**) malloc( sizeof( int* ) * Y_SIZE );
  7.  
  8. for( int j = 0 ; j < Y_SIZE ; j++ )
  9. {
  10. array[i][j] = (int*) malloc( sizeof( int ) * Z_SIZE );
  11. }
  12. }
To copy to clipboard, switch view to plain text mode 

This should create your 3-D array in whatever sizes you need assuming the array is:
Qt Code:
  1. array[X_SIZE][Y_SIZE][Z_SIZE]
To copy to clipboard, switch view to plain text mode 

Hope this helps!