Skip to content

Instantly share code, notes, and snippets.

@aakashns
Created June 14, 2012 14:55
Show Gist options
  • Save aakashns/2930831 to your computer and use it in GitHub Desktop.
Save aakashns/2930831 to your computer and use it in GitHub Desktop.
Swap integers using the XOR operator
void swap(int & a, int & b){
a = a ^ b;
b = a ^ b;
a = a ^ b;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment