Hi guys,
I was wondering if some1 out there could help me a little with my c++ work i gotta do!? Im a bit of a c++ rookie and am having issues setting up a multi-dimensional array in which the user can input the rows and columns. Its a relatively simple program (to which loads more has to be added!) but I cant even get this bit to work. Any help would be greatly appreciated!
int main()
{
int dx,dy;
cout << "Enter the width of the matrix\n";
cin >> dx;
cout << "Enter the height of the matrix\n";
cin >> dy;
int MyArray[dx][dy][5] = {0};
for (int i=0; i<dx; i++)
for (int j=0; j<dy; j++)
for (int k=0; k<5; k++)
{
cout << "MyArray[" << i << "][ " << j << "]: ";
cout << MyArray[i][j][k] << endl;
}
return 0;
}