Integral constants are integral constants. In the C language, the integer constants used are eight hexadecimal and three decimal.
1) Decimal integer constant: decimal integer constant without prefix. Its digital is 0~9.
The following numbers are valid decimal integer constants: 237,-568, 65535, 1627;
In the program is based on the prefix to distinguish the various binary numbers. Therefore, do not mistake the prefix when writing constants, resulting in incorrect results.
2) Octal integer constant: The octal integer constant must begin with 0, which is prefixed with 0 as the octal number. The digital value is 0~7. The octal number is usually an unsigned number.
The following numbers are valid octal numbers: 015 (decimal 13), 0101 (decimal 65), 0177777 (decimal 65535);
3) Hexadecimal integer constant: The prefix of the hexadecimal integer constant is 0X or 0x. Its digital value is 0~9,a~f or a~f.
The following numbers are valid hexadecimal integer constants: 0X2A (Decimal 42), 0XA0 (decimal 160), 0XFFFF (decimal 65535);
4) integer constant suffix: On a 16-bit word machine, the length of the basic integer is also 16 bits, so the range of the represented number is also limited.
The decimal unsigned integer constant has a range of 0~65535 and a signed number of -32768~+32767.
The octal unsigned number represents a range of 0~0177777. The hexadecimal unsigned number represents a range of 0x0~0xffff or 0X0~0XFFFF.
If the number used exceeds the above range, it must be represented by a long integer number. The number of long integers is denoted by the suffix "l" or "L".
How to represent the "C + +" integer constant