I am creating an address book in which the user can input a name and unlimited email addresses for each name. I have everything working except the ability to delete an address. I have used a map<string,emailStore> where emailStore is a string vector. the map name is name_to_email, and the initialized vector is book.
The program compiles and runs, but doesn't actually erase the value, what am I missing? Thanks in advance for any insight.
void delEmailAddressmanager()
{
cout << "What email address do you wish to delete?" ;
cin >> address;
for(map<string, emailStore>::iterator it = name_to_email.begin(); it !=name_to_email.end(); it++)
LB you have saved the day! book is the vector used in my map, address is what the user was inputing to have deleted. So I was thinking that while iterating through the second value of the map(the vector) that meant I would have to delete from book and not the map. I had tried "name_to_email.erase(it)" but with no success. Thanks for all your help!