5.1.1.1. Integer Literals

Felix namesuffix
tinyt
utinyut, tu
shorts
ushortus, su
int<none>, i
uintu, ui, iu
longl
ulongul, lu
vlongll, v
uvlongull, llu, uv, vu
int8i8
uint8u8
int16i16
uint16u16
int32i32
uint32u32
int64i64
uint64u64

An integer consists of a prefix, numeric form and suffix. Either the size indicator or signedness indicator 'u' or 'i' can be wholly capitalised (but note that lL is not allowed). The prefix denotes the radix as in the table below:

PrefixRadixnameAllowed digits
0b,0B2binary01
0o,0O8octal01234567
0d,0D,<none>10decimal0123456789
0x,0X16hexadecimal0123456789ABCDEFabcdef

The numeric form is followed by a non-empty string of allowed digits which may be separated by a single underscore. Each such underscore must be between two digits.

In addition an single underscore is allowed between a non-empty prefix and the numeric form, or the numeric form and a non-empty suffix. Underscores have no semantics and can be used to improve spacing.