If you want to identify if a char is a digit, #include <ctype.h> and use isdigit, or check that the char is between '0' and '9' inclusive.