+ 1
Erase a vector index
how do i erase the last index of the vector? https://code.sololearn.com/cSigrAsP7GLj/?ref=app
3 Respostas
+ 3
vec.pop_back();
+ 1
All vector functions are here: http://www.cplusplus.com/reference/vector/vector/
0
Try this
vec.erase(vec.end() - 1);
* Vector erase() method:
http://www.cplusplus.com/reference/vector/vector/erase/