I am making a game in C++ and I have an option so they can exit the game on the main menu.
I am very new to C++ and I cant get this if statement to work properly. Can someone fix it for me so it functions correctly. Thanks
char response;
cout <<"\n\n\tAre you sure you wish to exit the game? (y or n)";
cin >> response;
if(response = 'y')
{
cout <<"\n\tThank you for playing The Apocolypse, I hope you enjoyed it.";
cout <<"\n\n\tPress enter to close the game.";
system("CLS");
}
else if (response = 'n')
system("CLS");
{
menu();
}
Last edited on
=
and ==
are two different things.