2010年6月12日星期六

Bitwise Operators



Example of Bitwise Operators


http://en.wikipedia.org/wiki/Bitwise_operation

In the C programming language, the bitwise XOR operator is "^" (caret).

XOR

A bitwise exclusive or takes two bit patterns of equal length and performs the logical XOR operation on each pair of corresponding bits. The result in each position is 1 if the two bits are different, and 0 if they are the same. For example:

    0101
XOR 0011
= 0110

没有评论:

发表评论