0

Hi fellows, i would like how to stop user to input char in integers?

13th Oct 2022, 3:55 PM
light angel
light angel - avatar
2 Réponses
+ 2
You cannot stop users from inputting nonsense. You can only validate the input. E.g. the way proposed by Tomás Ribeiro
13th Oct 2022, 5:56 PM
Ani Jona 🕊
Ani Jona 🕊 - avatar
+ 1
You can do a while loop, inside you read as a "string" and check if the string can be converted to an integer, if so you break the loop, if not you keep on the loop.
13th Oct 2022, 5:02 PM
Tomás Ribeiro
Tomás Ribeiro - avatar