+ 2

How to remove error when i enter number in char input types

5th Aug 2017, 12:24 AM
Mohammad Mubdiul Hossain
Mohammad Mubdiul Hossain - avatar
3 Réponses
+ 9
Sample: try { std::cin >> stuff; std::cin.clear(); std::cin.ignore(512, '\n'); } catch (...) { std::cerr << "Invalid input."; }
5th Aug 2017, 2:30 AM
Hatsy Rei
Hatsy Rei - avatar
+ 2
can you show me the programme please in which you got the error
5th Aug 2017, 12:54 AM
Irwin Lopez
Irwin Lopez - avatar