Mail Archives: djgpp/1995/02/07/06:55:20
> Format %f in printf expects a float while 100.0 is a double number.
> Try %lf or %g.
Please, PLEASE, guys, let's not post untested ``solutions''.
Whoever posts a problem with printf() is confused enough already.
Is it too much to ask to actually compile and run your proposed
solution before you post it?
In printf(), %f expects a double, not a float, and every float
is converted to double when passed to printf(). This is ANSI
behavior for any function with variable number of arguments.
The %lf/%f controversy is an issue in scanf(), not in printf().
So whatever the problem in the original posting, it's *not*
because of %f.
- Raw text -