void John_is_3D(int dimx,int dimy,int dimz)
{
int ***John; // pointer to pointer to pointer
John = new int**[dimx]; // array of pointers to pointers
for(int x = 0;x<dimx;x++)
{
John[x] = new int*[dimy];
for(int y = 0;y<dimy;dimz++)
{
John[x][y] = new int[dimz];
for(int z = 0;z<dimz;z++)
{
John[x][y][z]= x*y*z;
cout << John[x][y][z];
}
}
cout <<endl;
}
}
can someone please point out whats wrong in here. I should dynamicly alloc 3d array and fill it with multiplication table