N
Nafai
Hello. I need to handle cin errors like these:
....
int n;
cout << "Type a number: ";
cin >> n;
// Check user actually typed a number.
....
CONSOLE:
Type a number: asdf >ENTER
....
Programs does strange things
....
How can I do that?
Thanks!
....
int n;
cout << "Type a number: ";
cin >> n;
// Check user actually typed a number.
....
CONSOLE:
Type a number: asdf >ENTER
....
Programs does strange things
....
How can I do that?
Thanks!