scanf doesn't work for variables of type double

Henry Spencer henry at utzoo.uucp
Sat Sep 16 04:37:07 AEST 1989


In article <12988 at uhnix1.uh.edu> jsmng at csune.cs.uh.edu () writes:
>... According to K&R, %f for double should be allowed in scanf...

Please read K&R more carefully.  In scanf, the specification for
double is %lf.  In *printf*, %f works for either float or double,
but in *scanf*, you have to make the distinction.
-- 
V7 /bin/mail source: 554 lines.|     Henry Spencer at U of Toronto Zoology
1989 X.400 specs: 2200+ pages. | uunet!attcan!utzoo!henry henry at zoo.toronto.edu



More information about the Comp.lang.c mailing list