Call strtol, make sure that the value stored in endptr is not equal to the input value (successful conversion) and is a pointer to a NUL byte (the entire string was used).
http://www.opengroup.org/onlinepubs/000095399/functions/strtol.html
explains that if you also want to detect overflow, the trick is to set errno to 0, then call strtol, and then check that errno is still 0.
, isspace(), . , strtol , , , "1" .
strtoll strtod , .