int ***array 3D;
int i, j, k;
i = height;
j = width;
k = depth;
// Allocate 3D Array
array3D = newint**[x];
for(i = 0; i < x; i++)
{
array3D[i] = newint*[y];
for(j = 0; j < y; j++)
{
array3D[i][j] = newint[z];
}}
// [i][j][k] means kth element of ith row and jth clumn, which itself is an array now
// You can fill array by using same loop and giving values
array3D[i][j][k] = value;
//In the same way deallocate the memory
This is begging to be done with proper C++ containers. It removes all that messing around manually with memory, and gives the standard library container functions to play with. Here's an example.