scanf doesn't work for variables of type double

Doug Gwyn gwyn at smoke.BRL.MIL
Sat Sep 16 02:43:48 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.

Nope.  %f is used for float, not double, in scanf format specs.
Use %lf for double.



More information about the Comp.lang.c mailing list