#include <is.h>

Andrew Koenig ark at alice.UUCP
Fri Dec 23 08:12:26 AEST 1988


In article <175 at wzv.UUCP>, wietse at wzv.UUCP (Wietse Z. Venema) writes:
 
> int isfloat(s)	/* wants a null-terminated string with f.p. number */
> char *s;
> {
> 	char junk = 0;
> 	float fval;

> 	return (sscanf(s,"%f%c",&fval,&junk) == 1);
> }

Nope, this one doesn't work either.

Give it something like "1e500" and it dumps core
due to a floating-point overflow.

-- 
				--Andrew Koenig
				  ark at europa.att.com



More information about the Comp.lang.c mailing list