Integer Constants are of four different bases:
- A number starting with a digit from 1 to 9 followed by a digit from 0 to 9 is a decimal base 10 constant.
- If a number begins with '0x' or '0X' and is followeed by digits from 0 to 9 and letters from a to f, or A to F, it is interpreted as a hexadecimal base 16 constant, like 0xbeef to 0XDEAD.
- If a number begins with 0 and is followed by digits from 0 to 7, it is interpeted as an octal base 8 constant, like 17l or 0xFfL.
- a 'u' or 'U to indicate an unsighed constant, like 33u
- a 'ul' or 'UL' to indicate an unsigned long constant like 32767
an integer constant takes on the minimum type necessary to be accurately represented, (possibly) starting as int and increasing from long to unsigned long
- octal and hexadecimal constants, and (in ANSI C) constants ending with a 'u' or 'U' may also be unsigned (which can hold larger values than int but may have fewer bytes than long)
in ANSI C, 0 is always unsigned (perhaps to reduce ambiguity on machines with one's complement arithmetic)