青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品

隨筆 - 45  文章 - 129  trackbacks - 0
<2007年1月>
31123456
78910111213
14151617181920
21222324252627
28293031123
45678910

專注于C++ P2P STL GP OpenSource等
Google

常用鏈接

留言簿(10)

隨筆分類

隨筆檔案

相冊

朋友

  • .NET

搜索

  •  

最新評論

閱讀排行榜

評論排行榜

先講#和#@字符:這兩個比較類似:前者是將所代表的東西字符串化,后者是將代表的東西字符化。

而##可以說是個符號粘合劑。(Modern C++中用來做編譯時期內(nèi)存檢查--2.1節(jié) 就是用了這個符號)

#的用法

The number-sign or "stringizing" operator (#) converts macro parameters (after expansion) to string constants. It is used only with macros that take arguments. If it precedes a formal parameter in the macro definition, the actual argument passed by the macro invocation is enclosed in quotation marks and treated as a string literal. The string literal then replaces each occurrence of a combination of the stringizing operator and formal parameter within the macro definition.

White space preceding the first token of the actual argument and following the last token of the actual argument is ignored. Any white space between the tokens in the actual argument is reduced to a single white space in the resulting string literal. Thus, if a comment occurs between two tokens in the actual argument, it is reduced to a single white space. The resulting string literal is automatically concatenated with any adjacent string literals from which it is separated only by white space.

Further, if a character contained in the argument usually requires an escape sequence when used in a string literal (for example, the quotation mark (") or backslash (\) character), the necessary escape backslash is automatically inserted before the character. The following example shows a macro definition that includes the stringizing operator and a main function that invokes the macro:

#define stringer( x ) printf( #x "\n" )

int main()
{
    stringer( In quotes in the printf function call\n ); 
    stringer( "In quotes when printed to the screen"\n );   
    stringer( "This: \"  prints an escaped double quote" );
}

Such invocations would be expanded during preprocessing, producing the following code:

int main()
{
   printf( "In quotes in the printf function call\n" "\n" );
   printf( "\"In quotes when printed to the screen\"\n" "\n" );
   printf( "\"This: \\\" prints an escaped double quote\"" "\n" );
}

When the program is run, screen output for each line is as follows:

In quotes in the printf function call

"In quotes when printed to the screen"

"This: \" prints an escaped double quotation mark"

Microsoft Specific

The Microsoft C (versions 6.0 and earlier) extension to the ANSI C standard that previously expanded macro formal arguments appearing inside string literals and character constants is no longer supported. Code that relied on this extension should be rewritten using the stringizing (#) operator.

END Microsoft Specific

#@的用法


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 marks and treated as a character when the macro is expanded. For example:

#define makechar(x)  #@x

causes the statement

a = makechar(b);

to be expanded to

a = 'b';

The single-quotation character cannot be used with the charizing operator.

END Microsoft Specific

##的用法

The 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 );
posted on 2007-01-19 14:03 CPP&&設(shè)計模式小屋 閱讀(1652) 評論(1)  編輯 收藏 引用 所屬分類: 其他

FeedBack:
# re: 關(guān)于 ## ,#以及#@的用法 2007-04-21 18:47 heweitykc
c++整的這么復(fù)雜啊 以后怎么維護(hù)啊!  回復(fù)  更多評論
  
青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品
  • <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
      <noscript id="pjuwb"></noscript>
            <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
              <dd id="pjuwb"></dd>
              <abbr id="pjuwb"></abbr>
              亚洲激情偷拍| 亚洲视频在线观看免费| 久久久久久久999精品视频| 亚洲在线免费视频| 国产精品有限公司| 久久久亚洲人| 老司机成人在线视频| 亚洲精品日日夜夜| 亚洲人成网站999久久久综合| 欧美大片在线看免费观看| 亚洲精品乱码久久久久久| 日韩天堂在线观看| 国产精品免费福利| 玖玖视频精品| 欧美高清你懂得| 午夜精品一区二区三区在线视 | 妖精视频成人观看www| 亚洲美女视频在线观看| 国产精品国内视频| 久久久久看片| 欧美久久电影| 久久国产精品久久久久久久久久| 久久精品日韩欧美| 一区二区黄色| 亚洲欧美成人| 亚洲精品美女在线观看| 亚洲字幕一区二区| 亚洲欧洲三级| 欧美一区二区三区在线免费观看| 亚洲国产精品一区二区www在线 | 久久久免费精品视频| 欧美电影免费观看高清完整版| 亚洲女人天堂av| 久久先锋影音av| 午夜天堂精品久久久久| 老司机精品视频网站| 亚洲欧美国产三级| 欧美激情影院| 蜜桃av一区| 国产日韩欧美一区二区三区在线观看| 欧美成人国产| 韩国女主播一区二区三区| 正在播放欧美一区| 亚洲精品一区二区三区不| 久久精品91| 久久激情网站| 国产精品乱人伦一区二区| 亚洲国产小视频在线观看| 精久久久久久久久久久| 亚洲一区视频在线| 亚洲视频999| 欧美伦理a级免费电影| 麻豆av福利av久久av| 国产精品伊人日日| 亚洲天堂av高清| 亚洲一区二区欧美日韩| 欧美精品粉嫩高潮一区二区| 免费日韩成人| 亚洲电影av| 久久裸体视频| 免费成人av在线看| 一区二区视频免费完整版观看| 午夜精品理论片| 久久黄色小说| 黄色亚洲精品| 久久精品夜夜夜夜久久| 久久久久久久久久久成人| 国产欧美视频一区二区三区| 亚洲欧美日韩精品久久亚洲区| 午夜日韩av| 国产九色精品成人porny| 亚洲永久免费av| 欧美一区午夜视频在线观看| 国产精品日韩一区二区| 亚洲综合精品四区| 久久精品国产精品亚洲综合| 国产在线麻豆精品观看| 久久婷婷国产综合精品青草| 欧美激情性爽国产精品17p| 日韩一级网站| 国产精品国产a级| 午夜一级久久| 免费视频一区| 99re6这里只有精品| 国产精品a久久久久| 亚洲欧美日韩视频一区| 久久综合中文色婷婷| 最新国产の精品合集bt伙计| 欧美日韩免费观看一区=区三区| 一区二区三区精密机械公司| 久久国产精品久久国产精品| 136国产福利精品导航网址应用| 欧美大片91| 亚洲自拍偷拍视频| 欧美99在线视频观看| 在线亚洲欧美| 国产综合亚洲精品一区二| 欧美电影免费观看网站 | 香蕉尹人综合在线观看| 国产真实乱子伦精品视频| 欧美电影电视剧在线观看| 亚洲特黄一级片| 欧美大片在线影院| 亚洲欧美激情精品一区二区| 在线精品国产欧美| 国产精品毛片a∨一区二区三区| 久久精品天堂| 一区二区三区日韩精品视频| 免费日韩成人| 欧美一区二区三区四区高清| 亚洲精品一区二区三| 国产日本欧美一区二区三区在线| 欧美电影免费网站| 久久精品国产欧美激情| 日韩一本二本av| 欧美刺激午夜性久久久久久久| 午夜精品久久久久久久99樱桃 | 国产视频精品免费播放| 欧美理论电影网| 久久久7777| 亚洲午夜视频在线观看| 亚洲激情二区| 欧美va亚洲va香蕉在线| 欧美专区亚洲专区| 亚洲一区二区三区在线视频| 亚洲日本电影| 一区二区三区在线看| 国产三级欧美三级日产三级99| 国产精品xnxxcom| 欧美黄色影院| 欧美激情网站在线观看| 乱码第一页成人| 久久这里只有精品视频首页| 久久精品免费| 欧美有码在线视频| 性色av一区二区三区红粉影视| 亚洲一区视频在线| 亚洲一区二区三区在线视频| 99综合视频| 宅男噜噜噜66国产日韩在线观看| 亚洲精品日韩综合观看成人91| 亚洲黄色精品| 亚洲日本一区二区| 日韩亚洲国产精品| 99成人在线| 亚洲天堂成人| 亚洲欧美日韩一区在线| 午夜精品久久久久久久99水蜜桃| 亚洲在线国产日韩欧美| 亚洲欧美中文另类| 欧美在线高清视频| 久久久久网址| 蜜乳av另类精品一区二区| 美女视频黄a大片欧美| 免费在线视频一区| 欧美日韩成人一区二区三区| 欧美色播在线播放| 国产精品亚洲精品| 狠狠色丁香久久综合频道| 在线精品在线| 日韩亚洲精品在线| 亚洲欧美另类国产| 久久久久久成人| 亚洲国产二区| 亚洲视频狠狠| 欧美一区二视频| 久久一日本道色综合久久| 欧美激情第二页| 国产精品入口尤物| 国内成人精品2018免费看| 在线精品视频免费观看| av成人免费观看| 久久国产精品久久国产精品 | 亚洲专区一二三| 麻豆91精品| 在线亚洲高清视频| 久久先锋影音| 欧美午夜精品理论片a级大开眼界| 国产日韩欧美高清| 亚洲精品网站在线播放gif| 亚洲视频精品| 久久蜜桃香蕉精品一区二区三区| 亚洲国内高清视频| 欧美一区三区二区在线观看| 欧美成人午夜免费视在线看片| 国产精品视频一二三| 91久久夜色精品国产网站| 午夜在线电影亚洲一区| 亚洲国产精品一区二区尤物区| 亚洲综合丁香| 欧美日韩精品在线观看| 在线播放亚洲一区| 午夜在线观看免费一区| 91久久精品网| 久久综合九色99| 狠狠色狠狠色综合日日五| 亚洲一区二区三区四区中文| 欧美激情欧美激情在线五月| 欧美一区二区三区在线| 国产精品白丝黑袜喷水久久久 |