Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
I doubt you will find any routine uses for these bit manipulation functions in your everyday programming. However, they are fun, and I thought a short program demonstrating the four logical functions (AND, NOT, OR, exclusive OR) would be interesting. I left out the remaining two functions, which shift bits right or left. One reason I decided to include these four bitwise functions is that the exclusive OR function (BXOR) has applications in ciphers and I have long been interested in codes and ciphers.
This collection of functions performs logical operations on bit strings. As a quick review, recall that A AND B is true if both A and B are true; NOT A reverses the value (0 to 1 or 1 to 0); A OR B is true if either A or B is true or if both A and B are true; A XOR (exclusive OR) B is true if A or B, but not both are true. The following table summarizes these rules: