#define STRING(x) #x #define OUT_PUT(a) printf("xxha: ---------- %s = %d\n", STRING(a), a); 需要输出变量i 时,只需要OUT_PUT(i) 就行了。