In C, is there a difference in the format specifiers% f,% e,% g,% E and% G when used in reading in a float variable with scanf? That is, will there be code snippet behavior
float x; scanf("%<one of f, e, g, E, G>", &x);
always depends on the choice of qualifier?
At first, I suggested that% f would interpret the decimal notation correctly, and% e would interpret the scientific notation correctly, but on my system, each one works fine anyway. But maybe my system is just liberal ...
I could not find a definite statement about this in my books or on the Internet ...
c floating-point scanf
lee77
source share