C++ Programming
How do you exit a while loop with an 'x'?
So far I have this
while(cin.good() && iCode!='x')
but if I run this and enter x, it is rejected by the fact it is not numerical
while (!cin.good() || iCode>999).
Also after a cout, how do you clear the line, I believe it is clreol(); but where do you put this to clear the line.
Thanks
How do you exit a while loop with an 'x'?
So far I have this
while(cin.good() && iCode!='x')
but if I run this and enter x, it is rejected by the fact it is not numerical
while (!cin.good() || iCode>999).
Also after a cout, how do you clear the line, I believe it is clreol(); but where do you put this to clear the line.
Thanks