Path: utzoo!attcan!uunet!auspex!guy From: guy@auspex.UUCP (Guy Harris) Newsgroups: comp.lang.c Subject: Re: #include Message-ID: <778@auspex.UUCP> Date: 22 Dec 88 07:26:38 GMT References: <354@greens.UUCP> <1920@paris.ics.uci.edu> <11252@haddock.ima.isc.com> Reply-To: guy@auspex.UUCP (Guy Harris) Organization: Auspex Systems, Santa Clara Lines: 13 >Btw, the posted version of the function accepts "3.14xyz" as valid (as does >atof() itself). I would think that the problem as stated should require that >string to be rejected. Also note that "strtod" can be used in code that would reject this string. It stops scanning at the first unrecognized character; for instance, if the floating-point number is expected to be terminated by a white-space character or by a '\0' (i.e., it's expected to be a token in a string, with tokens delimited by white space), the caller of "strtod" would pass it a non-NULL second argument that pointed to a "char *" variable initialized to point to the string; if, after calling "strtod", the "char *" variable still pointed to the string, or pointed to a character that wasn't white space or '\0', the string should be rejected.