Is it really that hard?
if(isalpha(char))
I don't know if that takes a string or not, but if it's only a character then just loop through.
server_crash
Postaholic
2,111 posts since Jun 2004
Reputation Points: 113
Solved Threads: 20
If isalpha() failes it does not mean that the character is a numeric digit, it could be anything else too. If you want to check for numeric digits then use isdigit(). And both only check one character, so if you have a whole string then you must check each character individually.
Ancient Dragon
Retired & Loving It
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343
Well, in that case just do it the hard way -- put this in a loop
if( string[i] >= '0' || string[i] <= '9' )
Ancient Dragon
Retired & Loving It
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343