What it is
Bitwise operators — AND, OR, XOR, NOT, and shifts — act on the individual binary digits of a number rather than its numeric value, and are the basis for flags, permission bitmasks, checksums, and low-level protocol framing.
When to use it
Reach for this when combining or checking permission flags, decoding a register value from a datasheet, debugging a network protocol header, or working out what a shift-and-mask expression actually produces.
Gotchas & limits
Results depend on the selected bit width: NOT and shifts wrap to that width, so the same operands can produce different results at 8-bit vs 32-bit. Right shift here is always logical (unsigned), never arithmetic sign-extension.