Use the XOR swap.
void swap( int* x, int* y ) { if (y != x) { // important *x ^= *y; *y ^= *x; *x ^= *y; } }