>> printf("%f", n);
[where n is a "double"]
In article <news:84**************************@posting.google. com>
Old Wolf <ol*****@inspire.net.nz> writs:
ITYM:
printf("%lf", n);
This is well-defined in C99, and does the same as using "%f", but
in C89 the combination of the "l" modifier with any of the floating
point formats in printf (e, E, f, g, and G) is technically undefined.
You always need the l in %lf when using scanf() on "double"s, but
in C89, you should not use the l modifier. The printf() and scanf()
functions are not as symmetric as they might first appear. This
false symmetry begins with the fact that scanf() takes the addresses
of the objects it fills in, and continues with %f vs %lf and gets
even more asymmetric with the behavior of %* directives. In printf,
for instance, %*d requires two int values and prints the second
using the first as a field width, but in scanf, %*d requires zero
pointers and skips the assignment of an "int" conversion.
--
In-Real-Life: Chris Torek, Wind River Systems
Salt Lake City, UT, USA (40°39.22'N, 111°50.29'W) +1 801 277 2603
email: forget about it
http://web.torek.net/torek/index.html
Reading email is like searching for food in the garbage, thanks to spammers.