#define 定义函数简单例子

来源:互联网 发布:mac android 真机调试 编辑:程序博客网 时间:2024/06/07 19:46


#define test1() test()

int test(void){
 return 1;
}

void main(){
int k;
k = test1();
printf("%d\n",k);
}

函数长时需要\分隔

#define GG(a, b, c, d, x, s, ac) { \

(a) += G((b), (c), (d)) + (x) + (UINT4)(ac); \

(a) = ROTATE_LEFT((a), (s)); \

a) += (b); \ }

 

 

\ 表示强制换行,而换行后的内容与前一行的内容编译器仍把它看作是同一行.

如果没有\编译器会把换行当做#define的结束;