Help with variable cubed array

Hey guys so I'm currently taking a class on C++ and am very new to it. I was screwing around and trying to figure out how to created a cubed array which the user could input the size of the array. I can't figure out how to actually input data into the cubed array. AND I've noticed that "Width" and "Depth" aren't populating, not really sure how to fix that either (This actually might be why i can't input data). Any help would be great! Thanks

#include<iostream>
using namespace std;

int main()
{
int ***cube_array, height=0, width=0, depth=0;
cout << "Enter the Height of the Cubed Array: " << endl;
cin >> height;
cube_array = new int**[height];
for (int i = 0; i < height; i++)
{
cube_array[i] = new int*[width];
for (int j = 0; j < width; j++)
{
cube_array[i][j] = new int[depth];
}
}

cout << "Enter " << height*width*depth << " numbers: " << endl;

for (int i = 0; i < height; i++)
for (int j = 0; j < height; j++)
for (int k = 0; k < height; k++)
cin >> cube_array[i][j][k];


for (int i = 0; i < height; ++i)
{
for (int j = 0; j < width; ++j)
{
delete [] cube_array[i][j];
}
delete[] cube_array[i];
}
delete[] cube_array;

getchar;
getchar;
return 0;
}
Topic archived. No new replies allowed.