jeudi 18 janvier 2018

Checking if value equals either a or b

I'm trying to have the user be able to control when they want to exit the while loop, and also i was wondering on how to exit the program when done

    cout<<"Play again? (Y/N)"<<endl;
char userInput;
cin>>userInput;
if (userInput='y'|'Y')
{
   cin.clear();
   cin.ignore();
   input();
   userInput=0;
}


else

{
    exit(0);
}
return 0;

Aucun commentaire:

Enregistrer un commentaire