Neat XOR trick
Submitted by Kirk Zurell on Mon, 2007-09-24 13:20.
tips
This is a neat trick using XOR, the most mysterious of the logical operators. Best of all for embedded, it requires no temporary locations.
//swap two values in place
if(x < y)
{
x = x ^ y;
y = y ^ x;
x = x ^ y;
}
Et voila!

delicious
digg
reddit
magnoliacom
technorati
eTPU_C:
C6808: