Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if (cin.fail()){
- cout << "\n\t\t/!\\ You did not enter an integer /!\\\n";
- cin.clear(); // get rid of failure state
- cin.ignore(numeric_limits<streamsize>::max(), '\n'); // discard 'bad' character(s)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement