Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Apple Xcode
- #include <stdio.h>
- // macro
- #define troca(the_x, the_y) { int the_temp; the_temp = the_x; (the_x) = (the_y); (the_y) = the_temp; }
- int main (int argc, const char * argv[])
- {
- /* troca de conteudos usando macro */
- int the_x, the_y;
- printf("x: ");
- scanf("%i", &the_x);
- printf("y: ");
- scanf("%i", &the_y);
- troca(the_x, the_y);
- printf("x = %i, y = %i", the_x, the_y);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement