The documentation on
printf
is as follows:
int printf ( const char * format, ... );
Print formatted data to stdout
Writes the C string pointed by format to the standard output (stdout). If format includes format specifiers (subsequences beginning with %), the additional arguments following format are formatted and inserted in the resulting string replacing their respective specifiers.
format
A C string that contains the text to be written to stdout.
It can
optionally contain embedded format specifiers that are replaced by the values specified in subsequent additional arguments and formatted as requested.
...
In your case of putting a
char
or
int
variable in place of
format above will fail because, well, they are not strings.