06-14-06 06:24 PM
Skarmander <invalid@dontmailme.com> writes:
> Joe Wright wrote:
> Hmm, and since %f is used to printf() a double, I can use %f to
> scanf() a double, right?
Wrong. With scanf %f denotes a float, and %lf denotes a double. This
difference is because the arguments to printf are subject to type
promotion, so any float arguments are converted to double. The
arguments to scanf are pointers, so there is a need to differentiate
between pointer to float and pointer to double.
--
Måns Rullgård
mru@inprovide.com
[ Post a follow-up to this message ]
|