📅  最后修改于: 2020-10-21 08:04:22             🧑  作者: Mango
C语言中的转义序列是在字符串字面量或字符使用时不能表示自身的字符序列。
它由开始的反斜线\两个或多个字符。例如:\ n代表换行。
Escape Sequence | Meaning |
---|---|
\a | Alarm or Beep |
\b | Backspace |
\f | Form Feed |
\n | New Line |
\r | Carriage Return |
\t | Tab (Horizontal) |
\v | Vertical Tab |
\\ | Backslash |
\’ | Single Quote |
\” | Double Quote |
\? | Question Mark |
\nnn | octal number |
\xhh | hexadecimal number |
\0 | Null |
#include
int main(){
int number=50;
printf("You\nare\nlearning\n\'c\' language\n\"Do you know C language\"");
return 0;
}
输出:
You
are
learning
'c' language
"Do you know C language"