I have tired several things....And i still can't pinpoint on what I can do differently.
I want the dowhile loop to run untill r, b or g is entered. I have tried commas like in the below code and other things exp...
while (pick != r || pick != 'g' || pick != 'b'); <---really thought that would work with the OR operators....
Each time it just keeps performing the dowhile loop even if I enter one of the 3 letters...It works when I only have one conidition in the dowhile loop, so are you only able to put one?
If so, how would i rewrite this code?
Thanks,
Derek
char pick;
do
{
cout << "What color do you want to bet on?\n";
cout << "[r]ed\t[b]lue\t[g]reen\n";
cin >> pick;
switch(pick)
{
case 'r':
cout << "You want red to win!\n";
break;
case 'g':
cout<< "You want green to win!\n";
break;
case 'b':
cout << "You want blue to win!\n";
break;
}
}while (pick != 'r','b','g');