typedef is handy when using stl containers to avoid typing. Read up on it. Below is a simple sample to help to compile, run, test and understand. Play around with it and when you understand whats going on, incorporate similar logic into your application.
Iterators are tricky and confusing at first, but its extensively used, so its worthwhile investment in time.
#include <iostream>
#include <vector>
int main( int argc, char *argv[])
{
/// typedef lets us alias names
typedef std::vector<std::string> TVec;
/// below is a list of favarite dogs
TVec v;
v.push_back("jake");
v.push_back("lucy");
v.push_back("paws");
std::cout << "Please enter name to remove:" << std::endl;
std::string who;
std::getline(std::cin,who);
/// find and remove name on list
bool found=false;
for( TVec::iterator iter=v.begin(); iter!=v.end() && found==false; ++iter )
{
if( *iter == who )
{
v.erase(iter); // iterator passed to erase
found=true; // exit the loop
}
}
/// inform user of status
if(found == true )
{
std::cout << who << " is removed" << std::endl;
}
else
{
std::cout << who << " is not on list" << std::endl;
}
return 0;
}