练习4-14 定义宏swap(t,x,y)以交换t类型的两个参数。(使用程序块结构会对你有所帮助。)
少使了一个参数,也能完成题意。
#include <stdio.h>
#define swap(x, y) \{ \x = x + y; \y = x - y; \x = x - y; \} \int main()
{int a = 12, b = 13;swap(int, a, b);printf("%d, %d\n", a, b);char c = 'c', d = 'd';swap(char, c, d);printf("%c, %c\n", c, d);return 1;
}