1. Bitwise AND operator (&)
Since any one is the result of the 0,& operation, it is 0, so you can use this operator to set the unnecessary bits in the variable to 0. The method is to create a ' mask ' and then use & to combine it with the original variable. such as: Letter=letter & 0x0F;
2. Bitwise OR operator (|)
One of the two bits is the result of the 1,or operation is 1, so the result of these two variables is that both bits are opened, such as: Style |= Hredraw | Vredraw;
3. Bitwise EOR operator (^)
Letter1 0100 0001
Letter2 0101 1010
After the EOR operation, they are:
Result 0001 1011
The XOR operator has an attribute, and the two variables exchange values without occupying any intermediate storage units. This applies to all integer values. Such as:
First ^= last; Result First is 0001 1011
Last ^= first; Result is 0100 0001
First ^= last; Result First is 0101 1010
4. Bitwise NOT operator (~)
The position of the number is reversed, 1 change 0,0 to 1.
5. Shift Operator (<<) (>>)
Moving the N-bit to the left is equivalent to multiplying the value by 2 n times, which is equivalent to 2n times. Moving right is equivalent to excluding.
Bitwise operator ACTION