Quote:
Originally Posted by ZenOswyn
char ch;
while(!ch || ch != 'x') {
|
Technically, the above yields undefined behaviour (reading the value of an uninitialised variable yields undefined behaviour). To avoid that, initialise ch to zero (or to some value not equal to 'x') before the loop.