So, im trying to create a 3 dimensional 5x3x2 vector, using the vector lib and saving the number 4 in every node.
Thats what im trying:
vector<vector<vector<int> > > vec (5,vector <int>(3,vector <int>(2,4)));
for a bi dimensional 5×8 saving the int 6 in every node, this works:
vector<vector<int> > vec (5,vector <int>(8,6));
You almost got it right — the second nested
vectorshould bevector<vector<int> >, not just avector<int>: