Is there any way I can accomplish this without an error?
Code:
void edit(employee a)
{
cout << "What would you like to change?" << endl
<< "1. Name" << endl << "2. Payrate" << endl;
string input;
getline(cin, input);
if (input == 1)
{
getline(cin, a.name);
}
else if (input == 2)
{
getline(cin, a.payrate);
}
else
{
cout << "Please enter a valid selection, 1 or 2." << endl;
}
}
I can't find a good tutorial on the basic string on the website, at least not for what I'm attempting to do, is this even possible?