scanf doesn't work for variables of type double

Shankar Unni shankar at hpclscu.HP.COM
Wed Sep 20 06:59:12 AEST 1989


> I posted  a question about scanf last week. I could not scanf a double

> careful enough. Using %lf and %F would have worked. Printf accepts %f
                               ^^^

NO. Don't use "%F". It was a non-standard extension to K&R at best, and
will not work at all for ANSI C (since %F is exactly equivalent to %f).

Stick to %lf.
-----
Shankar Unni                                   E-Mail: 
Hewlett-Packard California Language Lab.     Internet: shankar at hpda.hp.com
Phone : (408) 447-5797                           UUCP: ...!hplabs!hpda!shankar



More information about the Comp.lang.c mailing list