I'm having trouble with two nearly identical blocks of code in my program:
It stays at the prompt without advancing past it, no matter what garbage is typed in.Code:do
{
cout<<"What is your charater's name?\n";
cin.ignore();
getline( cin, yourname);
do
{
cout<<"Your character's name is "<<yourname<<". Is that okay?\n";
getline( cin, choice);
} while (toupper(choice[0]) != 'y' && toupper(choice[0]) != 'n');
if (toupper(choice[0] == 'n'))
{
ok=false;
}
else
{
ok=true;
}
}while (ok==false);