In C, `0x7FFF` and `0x8000` denote integer constants written with base-16 digits. The prefix `0x` identifies hexadecimal notation; digits `A`–`F` extend the values beyond `0`–`9`. The same numeric value can acquire different types depending on how it is written: `0x7FFF` is signed, while `0x8000` can be unsigned when it does not fit the signed type. section 5.3
Use hexadecimal deliberately in two related situations:
- Represent nonnegative integer constants compactly, using forms such as `0x7FFF`, `0x8000`, and `0xFFFFFFFF`. section 5.3
- Print bit patterns with `%x` or `%X`; each hexadecimal digit corresponds directly to four bits, making the representation preferable to octal for modern 8-bit-character architectures. section 8.3.4
- Avoid expressing negative values with hexadecimal constants: `-0x8000` remains unsigned in the relevant case, whereas decimal constants express negative values as intended. section 5.3
Reading a hexadecimal bit pattern
The hexadecimal digit `F` has value 15 and bit pattern `1111`; therefore a sequence such as `0xFFFFFFFF` exposes a 32-bit pattern compactly. Its interpretation still depends on the constant's type: the listed 32-bit example is unsigned, and applying unary minus produces `+1` through unsigned arithmetic.




