Link to home
Start Free TrialLog in
Avatar of nconfer
nconfer

asked on

How to check string to make sure it only contains numbers and no letters

I'm working on a c program and have run into a quick problem.

I am declaring a string using the following line of code
char teststring[255];

I'm then loading a line from a dat file I have into the string, and want to check and make sure that the string only has numbers in it and no letters or other characters before converting it to an integer.

can anyone point me in the right direction?  thanks.
ASKER CERTIFIED SOLUTION
Avatar of ozo
ozo
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of nconfer
nconfer

ASKER

Thank you for the help.  Much appreciated!