difference between %lf and %Lf?

Jan 11, 2011 at 5:16pm
Is there any difference between %lf and %Lf?
Jan 11, 2011 at 5:38pm
http://www.cplusplus.com/reference/clibrary/cstdio/printf/
l : The argument is interpreted as a long int or unsigned long int for integer specifiers (i, d, o, u, x and X), and as a wide character or wide character string for specifiers c and s.
L : The argument is interpreted as a long double (only applies to floating point specifiers: e, E, f, g and G).

so I assume %lf is the same as %f
Jan 11, 2011 at 11:37pm
so I assume %lf is the same as %f
Maybe, but I guess not for scanf.
Jan 12, 2011 at 12:22am
For printf(), the "%lf" is not valid -- it should be "%f".
For scanf(), it makes all the difference in the world -- use "%f" for float, "%lf" for double, and "%Lf" for long double.
Topic archived. No new replies allowed.