FIrst bookmark
this link and read it. It contains a reference
to the entire C Standard library.
As a rule of thumb: when the user types something the program didn't anticipate
for, prompt the user and get rid of the erroneous input and try again.
How exactly you want to do this is all up to you. Manual user input can be
really messy and complicated when you don't do it consistently.
If you do it right turn your code into a 'utilities' library ready for later use.
kind regards,
Jos