Why does `"%c"` exist in `printf` if `char` is converted to `int`? -
Why does `"%c"` exist in `printf` if `char` is converted to `int`? -
in c have "%c" , "%f" formats flags printf- , scanf-like functions. both of these function utilize variable length arguments ..., convert floats doubles , chars ints.
my question is, if conversion occurs, why separate flags char , float exist? why not utilize same flags int , double?
related question: why scanf() need "%lf" doubles, when printf() okay "%f"?
because way gets printed out different.
printf("%d \n",100); //prints 100 printf("%c \n",100); //prints d - ascii character represented 100 c printf varargs
Comments
Post a Comment