Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void eraseEvenVectorElements (std::vector<int>* v)
- {
- for(std::vector<int>::iterator it = v->begin(); it != v->end(); it++) {
- // be careful, at erasing "it" element, the vector is squeezed and "it" = (it+1),
- // so it should be incremented only once again
- v->erase(it);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement