How to XOR all of the bits of a single number in C?
<p>Is there a simple way to XOR all of the bits of a single number together, i.e. a unary XOR in C?</p>

<p>Something that has the effect of:</p>

<pre><code>result = ^(0x45); // ( 0 ^ 1 ^ 0 ^ 0 ^ 0 ^ 1 ^ 0 ^ 1 = 1)
result = ^(0x33); // ( 0 ^ 0 ^ 1 ^ 1 ^ 0 ^ 0 ^ 1 ^ 1 = 0)
</code></pre>