c/language/integer constant

Allows values of integer type to be used in expressions directly.

Syntax
An integer constant is a expression of the form

where
 * is a non-zero decimal digit, followed by zero or more decimal digits
 * is the digit zero followed by zero or more octal digits
 * is the character sequence or the character sequence  followed by one or more hexadecimal digits
 * is the character sequence or the character sequence  followed by one or more binary digits
 * , if provided, may contain one or both of the following (if both are provided, they may appear in any order):
 * (the character or the character )
 * (the character or the character )

Explanation
@1@ Decimal integer constant (base 10, the first digit is the most significant). @2@ Octal integer constant (base 8, the first digit is the most significant). @3@ Hexadecimal integer constant (base 16, the first digit is the most significant, the letters 'a' through 'f' represent the decimal values 10 through 15). @4@ Binary integer constant (base 2, the first digit is the most significant)

The following variables are initialized to the same value:

The following variables are also initialized to the same value:

The type of the integer constant
The type of the integer constant is the first type in which the value can fit, from the list of types which depends on which numeric base and which was used.

If the value of the integer constant is too big to fit in any of the types allowed by suffix/base combination and the compiler supports extended integer types (such as ), the constant may be given the extended integer type; otherwise, the program is ill-formed.