개요
- C++ 벡터 erase()
#include <iostream>
#include <vector>
using namespace std;
int main() {
vector<int> v = {100,101,102,103,104,105,106};
v.erase(v.begin()+2, v.begin()+4);
for(auto x: v) cout << x << ' ';
}
#include <iostream>
#include <vector>
using namespace std;
int main() {
vector<int> v = {100,101,102,103,104,105,106};
v.erase(v.begin()+2, v.begin()+4);
for(auto x: v) cout << x << ' ';
}