A decimal integer literal writes a whole-number constant with ordinary decimal digits and no nondecimal base prefix. For example, 123 denotes the value 123. section 5.3
A decimal constant in code
int count = 123; Here, 123 supplies the integer value assigned to count. Compare 077 for octal, 0xFFFF for hexadecimal, and 0b1010 for binary notation; binary literals were introduced in C23. section 5.3
Table 5.3 Examples for literals and their types, under the supposition that signed and unsigned have the commonly used representation with 32 bits
| Literal 𝑥 | Value | Type | Value of -𝑥 |
| 2'147'483'647 | +2,147,483,647 | signed | -2,147,483,647 |
| 2'147'483'648 | +2,147,483,648 | signed long | -2,147,483,648 |
| 4'294'967'295 | +4,294,967,295 | signed long | -4,294,967,295 |
0x7FFF'FFFF |
+2,147,483,647 | signed | -2,147,483,647 |
0x8000'0000 |
+2,147,483,648 | unsigned | +2,147,483,648 |
0xFFFF'FFFF |
+4,294,967,295 | unsigned | +1 |
| 1 | +1 | signed | -1 |
| 1U | +1 | unsigned | +4,294,967,295 |
Compare representative literal values and inferred types, including decimal boundary cases and hexadecimal notation. section 5.3
