At first, pls excuse my bad english, hope u can understand what i mean.
im trying to write a function doing the following:
- loop asking for user input, which should be a unsigned long (e.g.: 1234543,123131,12,123144)
- that input MUST only be numbers and no other characters, the length of the input cannot be determined BEFORE the input
- if the input is empty or consists of anything else but only numbers, i have to write an error msg
- after that error msg, i have to ask again for the input
i am trying to do this for hours, but i constantly get errors.
At first, i tryed it with a scanf in the loop, but apparently scanf cant ask for user input in a loop
Has anyone some tips or ideas how I can do it?