Bitwise Operators in C++ — a practical guide to C++ bitwise operators with clear examples you can reuse in real projects.
C++ Tutorial Series (22/111). Prefer one article? Read the complete C++ tutorial.
Short description
Common for flags and low-level protocols.
Bitwise
unsigned flags = 0;
flags |= 1u << 3;
flags &= ~(1u << 3);