#include <is.h>

Henry Spencer henry at utzoo.uucp
Thu Dec 22 05:45:13 AEST 1988


In article <354 at greens.UUCP> matthew at sunpix.UUCP ( Sun NCAA) writes:
>...and atof(); to do the string to float conversion. But no where could
>I find a function to validate the string to see if it did contain a number
>that atof(); would correctly interpret...

Some existing C implementations, and all future ANSI-conforming ones, have
a "strtod" function (and a "strtol" counterpart) that does atof's job but
gives you hooks to find out whether it worked and how much of the string
it used up.
-- 
"God willing, we will return." |     Henry Spencer at U of Toronto Zoology
-Eugene Cernan, the Moon, 1972 | uunet!attcan!utzoo!henry henry at zoo.toronto.edu



More information about the Comp.lang.c mailing list