Created
October 1, 2016 20:06
-
-
Save dusansimic/bc88f5e215fbc70db55416b3c7d266df to your computer and use it in GitHub Desktop.
Swap two numbers with macro code.
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
#define swap(a, b) do { \ | |
typeof(a) temp = a; \ | |
a = b; \ | |
b = temp; \ | |
} while (0); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment