how to make the c compiler print \n
Assuming you mean the pair of characters, \n
, as opposed to a newline character:
printf("\\n");
Depends what you need.
Either:
printf("\\n"); /* prints \n */
or:
printf("\n"); /* prints newline */
printf("\\n");
Escape sequence \\
represents \
How about
#error "\\n"
You can use \\n
to print \n
printf( "\\n" );
\n
putchar('\\');
putchar('n');
You can use escape char \
printf("\\n");
精彩评论