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

Popular posts from this blog

How do I check if an insert was successful with MySQLdb in Python? -

delphi - blogger via idHTTP : error 400 bad request -

postgresql - ERROR: operator is not unique: unknown + unknown -