Description
The compound bitwise XOR operator ^=
is often used with a variable and a constant to toggle (invert) particular bits in a variable.
A review of the Bitwise XOR ^
operator:
0 0 1 1 operand1 0 1 0 1 operand2 ---------- 0 1 1 0 (operand1 ^ operand2) - returned result
Syntax
x ^= y; // equivalent to x = x ^ y;
Parameters
x
: variable. Allowed data types: char, int, long
y
: variable or constant. Allowed data types: char, int, long