Linux C 中字符串化操作符#

 1 #include <stdio.h>
2
3 #define dprint( expr ) printf( "%s = %d \n", #expr , expr)
4
5 int main(void)
6 {
7 int x = 100;
8 int y = 2;
9
10 dprint(x/y);
11 dprint( x+y );
12 dprint( x+y+2 );
13 return 0;
14 }

打印信息:

*******************************************************

x/y = 50
x+y = 102
x+y+2 = 104

*******************************************************

你可能感兴趣的:(linux)