常量摘要Summary of Constants

constantconstant:
floating-point-constantfloating-point-constant

integer-constantinteger-constant

enumeration-constantenumeration-constant

character-constantcharacter-constant

floating-point-constantfloating-point-constant:
fractional-constant exponent-part optfloating-suffix optfractional-constant exponent-part optfloating-suffix opt

digit-sequence exponent-part floating-suffix optdigit-sequence exponent-part floating-suffix opt

fractional-constantfractional-constant:
digit-sequence opt.digit-sequencedigit-sequence opt.digit-sequence

digit-sequence .digit-sequence .

exponent-partexponent-part:
e sign optdigit-sequencee sign optdigit-sequence

E sign optdigit-sequenceE sign optdigit-sequence

sign: one ofsign: one of
+ -+ -

digit-sequencedigit-sequence:
digitdigit

digit-sequence digitdigit-sequence digit

floating-suffix: one offloating-suffix: one of
f l F Lf l F L

integer-constant:integer-constant:
decimal-constant integer-suffix optdecimal-constant integer-suffix opt

octal-constant integer-suffix optoctal-constant integer-suffix opt

hexadecimal-constant integer-suffix opthexadecimal-constant integer-suffix opt

decimal-constant:decimal-constant:
nonzero-digitnonzero-digit

decimal-constant digitdecimal-constant digit

octal-constant:octal-constant:
00

octal-constant octal-digitoctal-constant octal-digit

hexadecimal-constant:hexadecimal-constant:
0x hexadecimal-digit0x hexadecimal-digit

0X hexadecimal-digit0X hexadecimal-digit

hexadecimal-constant hexadecimal-digithexadecimal-constant hexadecimal-digit

nonzero-digit: one ofnonzero-digit: one of
1 2 3 4 5 6 7 8 91 2 3 4 5 6 7 8 9

octal-digit: one ofoctal-digit: one of
0 1 2 3 4 5 6 70 1 2 3 4 5 6 7

hexadecimal-digit: one ofhexadecimal-digit: one of
0 1 2 3 4 5 6 7 8 90 1 2 3 4 5 6 7 8 9

a b c d e fa b c d e f

A B C D E FA B C D E F

unsigned-suffix: one ofunsigned-suffix: one of
u Uu U

long-suffix: one oflong-suffix: one of
l Ll L

character-constantcharacter-constant:
' c-char-sequence' c-char-sequence

'L' c-char-sequence ''L' c-char-sequence '

integer-suffix:integer-suffix:
unsigned-suffix long-suffix optunsigned-suffix long-suffix opt

long-suffix unsigned-suffix optlong-suffix unsigned-suffix opt

c-char-sequence:c-char-sequence:
c-charc-char

c-char-sequence c-charc-char-sequence c-char

c-char:c-char:
除单引号 (')、反斜杠 (\) 或换行符 escape-sequence 以外的所有源字符集成员Any member of the source character set except the single quotation mark ('), backslash (\), or newline character escape-sequence

escape-sequence:escape-sequence:
simple-escape-sequencesimple-escape-sequence

octal-escape-sequenceoctal-escape-sequence

hexadecimal-escape-sequencehexadecimal-escape-sequence

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

\' \" \\ \?\' \" \\ \?

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

\ octal-digit octal-digit\ octal-digit octal-digit

\ octal-digit octal-digit octal-digit\ octal-digit octal-digit octal-digit

hexadecimal-escape-sequencehexadecimal-escape-sequence:
\x hexadecimal-digit\x hexadecimal-digit

hexadecimal-escape-sequence hexadecimal-digithexadecimal-escape-sequence hexadecimal-digit

请参阅See Also

词法语法Lexical Grammar