C语言-宏定义
宏定义
#include
#define NUM 5+2
int main() {
printf("%d", NUM * 3);
return 0;
}
/*
11 //5+2*3=11
*/
宏函数
#include
#define MAX(a,b) if(a>b){printf("%d",a);}else{printf("%d",b);}
int main(){
MAX(20,30)
return 0;
}
#include
#define NUM 5+2
int main() {
printf("%d", NUM * 3);
return 0;
}
/*
11 //5+2*3=11
*/
#include
#define MAX(a,b) if(a>b){printf("%d",a);}else{printf("%d",b);}
int main(){
MAX(20,30)
return 0;
}