I have a function which should very simply read in a line of text, but for whatever reason, it only reads a space. I tried changing the readline to a cin >> line, and that worked. But the readline(cin, string) does not.
void AddRestaurant() {
string restToAdd;
cout << "What is the name of the restaurant you want to add?" << endl;
getline(cin, restToAdd);
restuarants.push_back(restToAdd);
cout << restToAdd + " has been added" << endl << endl;
}
Anybody see my error?