Bitwise operations allow direct manipulation of individual bits within data types like integers.
Theory
Bitwise operators are essential for performing operations at the bit level, often used for tasks like masking, setting, and shifting bits.
- AND:
- OR:
- XOR:
- Shift left: (Shifts bits to the left by positions)
- Shift right: (Shifts bits to the right by positions)