Specifically, specific elements. A project requires us to delete elements in a vector via course number. I assumed one would use an iterator, so that being said, would this work?
void student::drop_course(int d) {
vector<int>::iterator f = find(c_id.begin(), c_id.end(), d);
vector.erase(f);
cout << "You have deleted course number " << d << endl;
}
Thanks in advanced.