problem with basic vector statements

When I compile it, it shows" no matching function for call to ....."
can anyone help me? Thanks a lot!

#include <iostream>
#include <vector>
using namespace std;

void PrintVectors(vector<int> numsList) {
int i;
for (i = 0; i < numsList.size(); ++i) {
cout << numsList.at(i) << " ";
}
cout << endl;
}

int main() {
vector<int> numsList;

numsList.push_back(101);
numsList.push_back(200);
numsList.push_back(103);

/* Your solution goes here */
numsList.erase(numsList.at(1));
numsList.insert(numsList.at(0), 100);
numsList.insert(numsList.at(2), 102);

PrintVectors(numsList);

return 0;
}
The erase function takes an iterator to the element that you want to remove as argument.

The first argument to insert should also be an iterator.

http://www.cplusplus.com/reference/vector/vector/erase/
http://www.cplusplus.com/reference/vector/vector/insert/
I see. Thank you so much!
Topic archived. No new replies allowed.