After asking the player whether they wish to play again, the asking function should return TRUE if either one of the following is true: First character of Response is ‘y’ or “Y”.
Why then doesn’t this work?
bool AskToPlayAgain()
{
cout << "Do you want to play again?\n";
string Response = "";
getline(cin, Response);
return ((Response[0]=='y')||(Response[0]=='Y'));
}
Specifically the return line at the end. Shouldn’t it return true if at least one of the nested conditionals is also true?
Thanks for any help!
-Ben