+ 2
How do ignore decimal numbers?
I want the the user to put a positive integer and i want it to ignore decimal numbers ,characterrs, and negative numbers
1 ответ
+ 5
You could use try and catch, if is not an integer the exception will take you to the catch part of the code, check this page for more information: http://www.cplusplus.com/doc/tutorial/exceptions/
hope it helps 😉