I took the summer off from c++ and before that I had only taken one semester, so I am pretty rusty.
I have this function that is supposed to add contacts into a structure of xbox gamer friends. At the end of the function It goes into an eternal loop. I have been working on it for two days now and I am stuck!! Any help would be greatly appreciated.
//adds a new contact to the xbox friends list of contacts.
void addcontacts(vector<XboxFriends> &contacts)
{
XboxFriends newXboxFriends;
cout << "Add a new friend profile...\n";
cout << "GamerTag: ";
getline(cin, newXboxFriends.gamertag);
newXboxFriends.ignore();
cout << "Real Name: ";
getline(cin, newXboxFriends.name);
cin.ignore();
cout << "Country: ";
getline(cin, newXboxFriends.country);
cin.ignore();
cout << "City: ";
getline(cin, newXboxFriends.city);
cin.ignore();
cout << "Favorite Games: ";
getline(cin, newXboxFriends.favoriteGames);
cin.ignore();
cout << "Age: ";
cin >> newXboxFriends.age;
cin.ignore();
contacts.push_back(newXboxFriends);
}