Created
March 28, 2017 22:28
-
-
Save scroobius-pip/c0bc716bd72258be2a64ce47eaafbdc8 to your computer and use it in GitHub Desktop.
Swapping with only two variables
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void s(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