Thursday, June 14, 2012

Swap Using Bitwise XOR

void swap(int & a, int & b){
a = a ^ b;
b = a ^ b;
a = a ^ b;
}
view raw xor_swap.cpp hosted with ❤ by GitHub

No comments:

Post a Comment