View Single Post
Old 03-18-2005, 11:53 AM   #2 (permalink)
DJMaze
Senior Contributor
 
DJMaze's Avatar
 
Join Date: Mar 2005
Posts: 757
DJMaze is on a distinguished road
strtod() converts a string to a double or long double value and can handle numbers like
+ 1231.1981 e-1
502.85E2
+ 2010.952
strtod stops reading the string at the first character that cannot be interpreted as an appropriate part of a double value.

Your pEnd must be '\0' else it could still fail.
The (pString != pEnd) is also TRUE on values like "502.85E2 not number"

atoi()
Is another way to check numberic values but then only with integers.
DJMaze is offline   Reply With Quote