반응형
find & erase
1.소스
#include <iterator> #include <vector> #include <string> using namespace std; int main() { vector<string> m; m.push_back("a"); m.push_back("b"); m.push_back("c"); string str = "f"; vector<string>::iterator it = find( m.begin() , m.end() , str ); if( it != m.end() ) { m.erase( it ); } return 0; }
반응형