Information Technology Reference
In-Depth Information
Figure 8-5 shows four examples of the bitwise logical operations.
Figure 8-5. Examples of bitwise logical operators
The following code implements the preceding examples:
const byte x = 12, y = 10;
sbyte a;
a = x & y; // a = 8
a = x | y; // a = 14
a = x ^ y; // a = 6
a = ~x; // a = -13
Search WWH ::




Custom Search