What is the correct format specifier for double
in printf? Is it %f
or is it %lf
? I believe it's %f
, but I am not sure.
Code sample
#include <stdio.h>
int main()
{
double d = 1.4;
printf("%lf", d); // Is this wrong?
}
转载于:https://stackoverflow.com/questions/4264127/correct-format-specifier-for-double-in-printf