Integer Validation

What is easiest and best way to validate that entry of 4 characters or less contain only integers?


  • I use a character array along with fgets; digits are easy to test using isdigit, and if it's a valid number, it's easy to convert to an integer.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


In this Discussion