August 2004
Intermediate to advanced
480 pages
9h 41m
English
For all of my griping in this chapter, the bitwise operators are actually very cool. The bitwise operators let you manipulate the individual bits that make up an integer value. You do so using the operators & (AND), | (OR), and ^ (XOR, the EXCLUSIVE OR). Using these operators with an integer value lets you determine the value (0 or 1) for the bit in the specified position.
If you haven't used these operators before, it might sound ridiculous to think of “2 OR 6 = 2” as being a meaningful expression. But it is. For that expression to make sense, we need to examine the bits of a number, which means you need to be able to visualize a base 10 number as a base 2 number. Base 10 numbers are what we use every day. ...
Read now
Unlock full access