Information Technology Reference
In-Depth Information
Integer Literals
Integer literals are the most commonly used of all literals. Integer type literals are written as a
sequence of decimal digits, with
￿No decimal point
￿
An optional suffix to specify the type of the integer
For example, the following lines show four literals for the integer 236. Each is interpreted
by the compiler as a different type of integer, depending on its suffix.
236 // int
236L // long
236U // unsigned
236UL // unsigned long
Integer type literals can also be written in hexadecimal (hex) form. The digits must be the hex
digits (0 through F), and the string must be prefaced with either 0x or 0X (numeral 0 , letter x ).
The integer literal formats are shown in Figure 8-1. Components with names in square
brackets are optional.
Figure 8-1. The integer literal formats
Search WWH ::




Custom Search