《c程序设计语言》读书笔记-4.14-定义宏交换两个参数

#include <stdio.h>
#include <math.h>
#include <stdlib.h>
#include <string.h>

#define swap(t,x,y) {     t _z;\
                        _z = y;\
                         y = x;\
                        x = _z;      }
int main()
{
    int a = 0,b = 1;
    swap(int,a,b);

    printf("%d %d\n",a,b);

    return 0;

}


posted @ 2014-11-12 22:48  司空格子Ored  阅读(190)  评论(0编辑  收藏  举报