#define termination_trace(level)\
printf("%s:%*shandling %snormal termination\n",\
#level,(int)(2 *(level)),"",\
AbnormalTermination()?"ab":"")这里,#level是什么意思?
printf("%s:%*shandling %snormal termination\n",\
#level,(int)(2 *(level)),"",\
AbnormalTermination()?"ab":"")这里,#level是什么意思?
解决方案 »
- VC下使用unix的标准c问题
- 救命!怎样在VC里打印一个MsFlexGrid里的内容
- 如何获取用户对word文档的操作
- 非绝顶高手不能解决的界面问题?CListView 编辑问题......
- 怎样将“数字和时间”类型的值赋给控件变量呢?
- 只是用SDK创建一个窗口的小问题
- 各位高手,我当时在装Win 2000 Server时,进入Win 2000 Server需要配置服务,我在那时候没配置服务器,到以后每次启动都要求配置服务器,
- 如何利用CView在框架窗口中创建编辑框?
- 帮我……
- MFC+webbrowser抓取页面动态生成的网页信息
- 从可执行程序中,获得一段特定功能的汇编代码,是怎样实现的??
- 如何打印子窗口的内容?
Preprocessor Operators
Microsoft Specific The charizing operator can be used only with arguments of macros. If #@ precedes a formal parameter in the definition of the macro, the actual argument is enclosed in single quotation s and treated as a character when the macro is expanded. For example:#define makechar(x) #@x
causes the statementa = makechar(b);
to be expanded toa = 'b';
The single-quotation character cannot be used with the charizing operator.END Microsoft Specific
Preprocessor OperatorsThe double-number-sign or "token-pasting" operator (##), which is sometimes called the "merging" operator, is used in both object-like and function-like macros. It permits separate tokens to be joined into a single token and therefore cannot be the first or last token in the macro definition.
If a formal parameter in a macro definition is preceded or followed by the token-pasting operator, the formal parameter is immediately replaced by the unexpanded actual argument. Macro expansion is not performed on the argument prior to replacement.
Then, each occurrence of the token-pasting operator in token-string is removed, and the tokens preceding and following it are concatenated. The resulting token must be a valid token. If it is, the token is scanned for possible replacement if it represents a macro name. The identifier represents the name by which the concatenated tokens will be known in the program before replacement. Each token represents a token defined elsewhere, either within the program or on the compiler command line. White space preceding or following the operator is optional.
This example illustrates use of both the stringizing and token-pasting operators in specifying program output:
#define paster( n ) printf( "token" #n " = %d", token##n )
int token9 = 9;
If a macro is called with a numeric argument like
paster( 9 );
the macro yields
printf( "token" "9" " = %d", token9 );
which becomes
printf( "token9 = %d", token9 );