Recentely I have seen that if I use printf
with \'foo\' I get a warning.
printf(\'numero\');
warning: character con
In c the string delimiter is "
, the '
is used for character constants.
The double quotes "
will generate a string, a sequence of bytes with a terminating '\0'
byte.
Example:
const char *string = "Example";
/* the sequence -> ['E', 'x', 'a', 'm', 'p', 'l', 'e', '\0'] is generated */
The '
will generate an integer, in the case of a single character it's the ascii value that it represents, in case of multiple characters it's implementation defined.
Example:
char A = 'A'; /* the ascii value of 'A', 0x41 or 65 decimal */
Multicharacter strings, will also generate an integer, but it's value changes depending on the c implementation/compiler.