First page Back Continue Last page Graphics
students.erase(students.begin() + i);
The vector container includes a member function called erase to remove an element from the vector.
The argument specifies which element to remove.
No version of erase operates on indices.
We specify by adding our index value to the value returned by students.begin()