The Bitwise XOR
The XOR operator that is also denoted by ^, merge bits like that if exactly one operand is 1, and then the result is 1. Or else, the result is zero. The following instance displays the effect of the ^. This instance also demonstrates a useful attribute of the XOR operation. Note that how the bit pattern of 42 is inverted when the second operand has a 1 bit. Whenever the second operand has a zero bit, the first operand is not change. You will search this property useful whenever performing a few categories of bit manipulations.
00101010 42
^00001111 15
---------------
00100101 37