S
Stephen Tyndall
Hey. I was attempting a four-dimensional array and I couldn't get it to
work. The code below gave me 23 errors:
// BEGIN CODE
int main() {
int nArray[2][2][2][2] = {
{ { {1,2} , {3,4} } , { {5,6} , {7,8} } }
{ { {9,10} , {11,12} } , { {13,14} , {15,16} } }
};
cout << "nArray[0][0][0][0]: " << nArray[0][0][0][0] << endl;
cout << "nArray[1][0][1][0]: " << nArray[1][0][1][0] << endl;
cout << "nArray[1][1][0][1]: " << nArray[1][1][0][1] << endl;
return 0;
}
// END CODE
I'm fairly certain that the code should work; it was an expansion on a
working 3D array I had just finished, and I've gone over it several times.
I'm pretty sure I'll never need a 4D array, but I'd like to know why this
one doesn't work.
work. The code below gave me 23 errors:
// BEGIN CODE
int main() {
int nArray[2][2][2][2] = {
{ { {1,2} , {3,4} } , { {5,6} , {7,8} } }
{ { {9,10} , {11,12} } , { {13,14} , {15,16} } }
};
cout << "nArray[0][0][0][0]: " << nArray[0][0][0][0] << endl;
cout << "nArray[1][0][1][0]: " << nArray[1][0][1][0] << endl;
cout << "nArray[1][1][0][1]: " << nArray[1][1][0][1] << endl;
return 0;
}
// END CODE
I'm fairly certain that the code should work; it was an expansion on a
working 3D array I had just finished, and I've gone over it several times.
I'm pretty sure I'll never need a 4D array, but I'd like to know why this
one doesn't work.