You can try to make a four-dimensional array and hopefully the below code will work for you:
Code:
TH009MA@th009ma-shl2-01 /cygdrive/d/temp
$ cat junk.cpp
#include <iostream>
using namespace std;
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;
}
TH009MA@th009ma-shl2-01 /cygdrive/d/temp
$ g++ -o junk junk.cpp
TH009MA@th009ma-shl2-01 /cygdrive/d/temp
$ ./junk
nArray[0][0][0][0]: 1
nArray[1][0][1][0]: 11
nArray[1][1][0][1]: 14
Bookmarks