Information Technology Reference
In-Depth Information
The integer literal suffixes are listed in Table 8-1. For a given suffix, the compiler will inter-
pret the string of digits as the smallest of the corresponding integer types that can represent the
value without losing data.
For example, take the literals
236
and
5000000000
, where neither of them has a suffix. Since
236
can be represented with 32 bits, it will be interpreted by the compiler as an
int
. The larger
number, however, will not fit into 32 bits, so it is interpreted as a
long
.
Table 8-1.
Integer Literal Suffixes
Suffix
Integer Type
Notes
int
,
uint
,
long
,
ulong
None
U
,
u
uint
,
ulong
L
,
l
long
,
ulong
Using the lowercase letter
l
is not recommended, as it is
easily mistaken for the digit
1
.
ul
,
uL
,
Ul
,
UL
lu
,
Lu
,
lU
,
LU
ulong
Using the lowercase letter
l
is not recommended, as it is
easily mistaken for the digit
1
.