In C you have the "%c"
and "%f"
formats flags for printf
- and scanf
-like functions. Both of these function use variable length arguments ...
, which always convert floats
to doubles
and chars
to ints
.
My question is, if this conversion occurs, why do separate flags for char
and float
exist? Why not just use the same flags as for int
and double
?
Related question:
Why does scanf() need "%lf" for doubles, when printf() is okay with just "%f"?