vector<vector<vector<int> > > array3D;
int first_dim = 10;
int second_dim = 10;
int third_dim = 10;
array3D.resize(first_dim);
for (int i = 0; i < first_dim+1; ++i) {
array3D[i].resize(second_dim);
}
for (int i = 0; i < first_dim+1; ++i) {
for (int j = 0; j < second_dim+1; ++j) {
array3D[i][j].resize(third_dim);
for (int j = 0; j < second_dim+1; ++j) {
array3D[i][j].resize(third_dim);
}
array3D[2][3][4] = 20; //simply use it.
No comments:
Post a Comment