Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

how to remove an element from a vector by value c++

std::vector<int> v; 
// fill it up somehow
v.erase(std::remove(v.begin(), v.end(), 99), v.end()); 
// really remove all elements with value 99
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #remove #element #vector
ADD COMMENT
Topic
Name
3+9 =