My compiler complains.
#include <iostream>
#include <vector>
using namespace std;
int main(){
vector<string> vec[2];
vec[0].push_back("test1");
vec[0].push_back("test2");
cout << vec[0][0] << endl;
vec[0].erase(vec.begin());
cout << vec[0][1] << endl;
}
What is wrong when I call erase?
vecis an array ofvector<string>s. I believe you meantvec[0].begin()like so: