C 字符常量

“字符常量”通过在单引号 (' ') 内封闭可表示的字符集中的单个字符来构成。 字符常量用于表示执行字符集内的字符。

语法

character-constant
“ **** c-char-sequence ”

L” c-char-sequence “

c-char-sequence:
c-char

c-char-sequence c-char

c-char:
除单引号 (')、反斜杠 (\) 或者换行符以外的所有源字符集成员

escape-sequence

escape-sequence:
simple-escape-sequence

octal-escape-sequence

hexadecimal-escape-sequence

simple-escape-sequence: one of
\a \b \f \n \r \t \v

\' \" \\ \?

octal-escape-sequence:
\ **** octal-digit

\ octal-digit octal-digit

\ octal-digit octal-digit octal-digit

hexadecimal-escape-sequence
\x hexadecimal-digit

hexadecimal-escape-sequence hexadecimal-digit

另请参阅

C 常量