# 和 ## 操作符是和#define宏使用的. 使用# 使在#后的首个参数返回为一个带引号的字符串. 例如, 命令
#define to_string( s ) # s
将会使编译器把以下命令
cout << to_string( Hello World! ) << endl;
理解为
cout << "Hello World!" << endl;
使用##连结##前后的内容. 例如, 命令
#define concatenate( x, y ) x ## y
int iValueA = 10;
int iValueB = 10;将会使编译器把 cout << concatenate( iValueA ,iValueB ) << endl;解释为 cout << iValueA iValueB << endl;
理所当然,将会在标准输出处显示'1010'.
612

被折叠的 条评论
为什么被折叠?



