E
Edward
When cin (or any other istream objects) tries to extract a value into
a wrong type it will not accept any other inputs anymore. All calls to
operator>>() will fail.
code:
int x;
cin >> x;
// when user types 'a' and hits enter cin is no longer functional.
Is there any way to revive an input stream after such an error?
a wrong type it will not accept any other inputs anymore. All calls to
operator>>() will fail.
code:
int x;
cin >> x;
// when user types 'a' and hits enter cin is no longer functional.
Is there any way to revive an input stream after such an error?