Hi, guys. How do you detect whether an input with 'int' datatype is an integer and not letters or other characters?
Is there a built-in function in C that allows one to do this?
I know that if I use the 'char' datatype, I can check whether the input is a digit or not by using isdigit(int c) but I need to ask the user to input an integer that can be more than 5,000 in value. If I use char as the datatype, I can only check the first digit and not the rest.
Thanks in advance,
Darr
Is there a built-in function in C that allows one to do this?
I know that if I use the 'char' datatype, I can check whether the input is a digit or not by using isdigit(int c) but I need to ask the user to input an integer that can be more than 5,000 in value. If I use char as the datatype, I can only check the first digit and not the rest.
Thanks in advance,
Darr