I'm brand new into C++. I would like to know, why my code is not working. I've got string called Response. If the response begins with y/Y it should proceed. However I would like to proceed when the user types " y"/" Y" (the white space) as well. Here is my code. Thanks in advance!
bool AskToPlayAgain()
{
std::cout << "Would you like to play again? Yes/N";
std::string Response = "";
std::getline(std::cin, Response);
return (Response[0] == 'y') || (Response[0] == 'Y' +) ||(Response[0] == ' y' +) (Response[0] == ' Y' +);
std::cout << std::endl;
}