I’m having problems removing a vector from a “multidimensional vector”
I would like to achieve this:
1 1 1 1 1 1 1 1
2 2 2 2 2 2 2 2
3 3 3 3 4 4 4 4
4 4 4 4
for example
vector<vector<int>>vec;
for i...//give vec values...
vec[3].erase(vec.begin(),vec.end());
It seems like using vector.erase() or vector.clear() leaves an empty vector at the “third row”
Is there a way to completetly remove that vector so that
vec[3]=4 4 4 4
Thanx for a great forum…
/Bux
The following line removes the third element of
vec. If it had four elements, it will have three after the line is executed.The following line, on the other hand, will leave the third vector empty.