6.11 Compound Bitwise Operators
As with the arithmetic operators, each bitwise operator has a corresponding compound operator that allows the operation and assignment to be performed using a single operator:
Operator |
Description |
x &= y |
Perform a bitwise AND of x and y and assign result to x |
x |= y |
Perform a bitwise OR of x and y and assign result to x |
x ^= y |
Perform a bitwise XOR of x and y and assign result to x |
x <<= n |
Shift x left by n places and assign result to x |
x >>= n |
Shift x right by n places and assign result to x |
Table 6-5