Guest User

Untitled

a guest
Apr 26th, 2018
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.16 KB | None | 0 0
  1. void xorSwap (int* x, int* y) {
  2.     if (x != y) { //ensure that memory locations are different
  3.        *x ^= *y;
  4.        *y ^= *x;
  5.        *x ^= *y;
  6.     }
  7. }
Add Comment
Please, Sign In to add comment