C Integer Constants
An “integer constant” is a decimal (base 10), octal (base 8), or hexadecimal (base 16) number that represents an integral value. Use integer constants to represent integer values that cannot be changed.
Integer constants are positive unless they are preceded by a minus sign (–). The minus sign is interpreted as the unary arithmetic negation operator. (See Unary Arithmetic Operators in Chapter 4 for information about this operator.)
If an integer constant begins with the letters 0x or 0X, it is hexadecimal. If it begins with the digit 0, it is octal. Otherwise, it is assumed to be decimal.
The following lines are equivalent:
0x1C /* = Hexadecimal representation for decimal 28 */
034 /* = Octal representation for decimal 28 */
No white-space characters can separate the digits of an integer constant. These examples show valid decimal, octal, and hexadecimal constants.
/* Decimal Constants */
/* Octal Constants */
/* Hexadecimal Constants */
0xa or 0xA
0x7dB3 or 0X7DB3