#include <stdio.h>
int main()
{
printf("Hello\c!\n");
return 0;
}
Output : Helloc!
So , when \[some_undifined_symbol]
appeared in printf
's format string, it just ignore the \
?
#include <stdio.h>
int main()
{
printf("Hello\c!\n");
return 0;
}
Output : Helloc!
So , when \[some_undifined_symbol]
appeared in printf
's format string, it just ignore the \
?
\c
is not an escape sequence that is already defined, but it's better to avoid using it because it's reserved:
C99 §6.11.4 Character escape sequences
Lowercase letters as escape sequences are reserved for future standardization. Other characters may be used in extensions.
You have the following escape sequences defined for c
:
\'
single quote\"
double quote\\
backslash\0
null character\a
audible bell\b
backspace\f
form feed - new page\n
line feed - new line\r
carriage return\t
horizontal tab\v
vertical tab\nnn
arbitrary octal value\xnn
arbitrary hexadecimal value