" cout << endl << "Press X to Exit" << endl ;
cin >> r ;
if (r == !'X' or !'x' )
goto loop ;
return 0;
} "
is never going to loop
and
" cout << endl << "Press R to Repeat" << endl ;
cin >> r ;
if (r == 'R' or 'r' )
goto loop ;
return 0;
} "
is always going to loop !!
HELP PLEASE!!
Cant figure what ive done wrong, I have other ifs working in the same program, and the complier isnt saying there is an error
X and x are essentially codes from the ascii table.
'X' being equal to 58 and 'x' equaling 78.
So your conditional can be reinterpreted as:
if( r == !58 || ! 78 )
That ends up negating the value of those two numbers. I believe in essence, you're comparing r to 0, but it's it's been a while since I played such boolean games. In addition, a comparison requires two terms.