+ 1
In c++ code, suppose user submit char instead of integers then how can i display a error msg that's you have wrongly submit?
Suppose there is code of c++ for finding the largest number and user have to submit number and if user submit character also then how can i display warning msg that's you have submitted char, take only integers.. If possible please help me
2 odpowiedzi
+ 1
try {
cin >> number;
}
catch (Exception e) {
cout << "Invalid input" << endl;
}