I have a 4D vector of following type:
vector< vector< vector< vector< unsigned > > > > vec
I don't know the size of the 4th dimension at the beginning, so I am trying to resize the first 3 dimension in the following way:
vec.resize(x.size(), vector< vector< vector< unsigned > > >
(y.size(), vector< vector< unsigned > >(2)));
where x and y are of type vector<unsigned>
After I resized the first 3 dimensions in the above way mentioned I can't access any element from dimension 3(i.e vec[i][j][1]
).
Can anyone please suggest what am I missing here?