Don't forget the following line in C:

a ^= b ^= a ^= b;

It may not be obvious but, assuming a and b are integers, this single line swaps the values in a and b. It takes advantage of the fact that, given x XOR y = z, you can determine any of x, y, or z, given the other two. Pretty nifty, if you ask me.


Ok, I just now noticed the "xor swap" node has this exact idea already there. I swear I DID NOT see it there until after I posted this writeup, but if you don't believe me, I'll understand.