Summary of Constants

constant :

floating-point-constant
integer-constant
enumeration-constant

character-constant

floating-point-constant :

fractional-constant exponent-part opt floating-suffix opt
digit-sequence exponent-part floating-suffix opt

fractional-constant :

digit-sequence opt . digit-sequence
digit-sequence .

exponent-part :

e sign opt digit-sequence
E sign opt digit-sequence

sign :  one of

+  –

digit-sequence :

digit
digit-sequence digit

floating-suffix : one of

f  l  F  L

integer-constant :

decimal-constant integer-suffix opt
octal-constant integer-suffix opt
hexadecimal-constant integer-suffix opt

decimal-constant :

nonzero-digit
decimal-constant digit

octal-constant :

0
octal-constant octal-digit

hexadecimal-constant :

0x hexadecimal-digit
0X hexadecimal-digit
hexadecimal-constant hexadecimal-digit

nonzero-digit : one of

1 2 3 4 5 6 7 8 9

octal-digit : one of

0 1 2 3 4 5 6 7

hexadecimal-digit : one of

0 1 2 3 4 5 6 7 8 9
a b c d e f
A B C D E F

unsigned-suffix : one of

u U

long-suffix : one of

l L

character-constant :

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

integer-suffix :

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

c-char-sequence :

c-char
c-char-sequence c-char

c-char :

Any member of the source character set except the single quotation mark ('), backslash (\), or newline character
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