Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #define SWAP(type, x, y){\
- type tmp = x;\
- x = y;\
- y = tmp;\
- }
- int main(void)
- {
- int x = 5;
- int y = 8;
- printf("x = %d, y = %d\n", x, y);
- printf("SWAP\n");
- SWAP(int, x, y);
- printf("x = %d, y = %d\n", x, y);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement