So I want to remove an item in a vector. I dont know where in the vector it is I just want to remove it. I have looked around and vectors have a lot of nice functionality. what I am asking is,
is there a way that is better than to run a loop that checks vector
if the vector at location i is == items
remove vector at i.
1 2 3 4 5 6 7 8 9
for(int i = 0; i < myvector.size(); i++)
{
if(myvector.at(i) == item)
{
myvector.erase (myvector.begin()+i);
}
}