0

How to prevent user from entering number in c++?

9th Oct 2017, 7:25 PM
sultan
2 Antworten
+ 13
This code prevents Integer input and asks for the correct one which just contains characters. [http://cpp.sh/9j4d] https://code.sololearn.com/ceHKDfo2cgVE/?ref=app
9th Oct 2017, 8:23 PM
Babak
Babak - avatar
+ 3
You can't prevent users from doing anything. You can detect that they have enter something and ignore/complain as needed. Read the input as strings, verify the characters are as expected, and complain or process as desired.
9th Oct 2017, 8:21 PM
John Wells
John Wells - avatar