cppreference.com -> 转义字符

常量转义字符

以下的转义字符使普通字符表示不同的意义.

转义字符 描述
\' 单引号
\" 双引号
\\ 反斜杠
\0 空字符
\a 响铃
\b 后退
\f 走纸
\n 换行
\r 回车
\t 水平制表符
\v 垂直制表符
\xnnn 表示十六进制数(nnn)

以下是使用转义字符的代码示例:

printf( "This\nis\na\ntest\n\nShe said, \"How are you?\"\n" );

输出:

This
is
a
test

She said, "How are you?"

相关文章:

  • 2022-12-23
  • 2021-12-19
  • 2021-12-19
  • 2021-04-29
猜你喜欢
  • 2022-12-23
  • 2021-12-19
  • 2021-05-14
  • 2022-01-11
  • 2022-12-23
相关资源
相似解决方案