#include <stdio.h> #define A(x, y)((x) * (y)) #define B(x, y)(x * y) void main() { //非表达式参数 printf("%d\n", A(11, 3)); //33 (11)*3 printf("%d\n", B(11, 3)); //33 11*3 //表达式参数 printf("%d\n", A(6 + 5, 3)); //33 (6+5)*3 printf("%d\n", B(6 + 5, 3)); //21 6+5*3 //宏内的括号可以保证算术优先级,因为参数可能是表达式 }
标签:11,定义,33,括号,参数,printf,表达式 From: https://www.cnblogs.com/anzf/p/16902662.html