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

隨筆 - 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>
              日韩一级精品视频在线观看| 99pao成人国产永久免费视频| 国产精品一区一区| 国产精品久久久久久久7电影| 欧美日韩亚洲三区| 国产精品xxxxx| 国产精品成人一区| 国产精品区一区二区三区| 国产精品乱码一区二三区小蝌蚪 | 欧美一区二视频| 香蕉成人伊视频在线观看| 欧美一区二区视频在线| 欧美在线观看你懂的| 久久精品男女| 快she精品国产999| 欧美大片在线看免费观看| 最近中文字幕日韩精品| 亚洲人成网站影音先锋播放| 亚洲免费观看视频| 亚洲欧美日韩直播| 久久久噜噜噜久噜久久 | 午夜在线一区| 久久视频在线看| 欧美美女日韩| 国产精品毛片在线看| 国产亚洲精品一区二555| 在线不卡a资源高清| 99视频有精品| 欧美一级播放| 欧美国产视频在线观看| 亚洲剧情一区二区| 亚洲欧美日韩另类| 久久综合五月| 欧美日韩午夜激情| 国产亚洲观看| 99v久久综合狠狠综合久久| 欧美一级电影久久| 亚洲电影在线| 亚洲天堂免费在线观看视频| 久久精品成人欧美大片古装| 欧美激情一区二区三区蜜桃视频| 欧美日韩在线免费观看| 国外成人在线视频| 一本色道久久综合一区| 久久久精品动漫| 亚洲另类春色国产| 欧美在线视频观看免费网站| 欧美伦理视频网站| 国内揄拍国内精品少妇国语| 一区二区福利| 免费在线亚洲欧美| 亚洲少妇自拍| 欧美成人精品一区| 国产综合一区二区| 亚洲性感美女99在线| 免费观看国产成人| 亚洲一区二区在线看| 欧美成人午夜免费视在线看片| 国产精品午夜av在线| 日韩视频在线免费| 老司机精品福利视频| 亚洲婷婷国产精品电影人久久| 老妇喷水一区二区三区| 国产婷婷成人久久av免费高清 | 国产精品大片免费观看| 在线观看一区欧美| 欧美综合77777色婷婷| 亚洲精品乱码久久久久久蜜桃91| 欧美一级黄色录像| 国产精品sm| 99国产成+人+综合+亚洲欧美| 久久亚洲精品欧美| 小处雏高清一区二区三区 | 久久久999精品视频| 妖精视频成人观看www| 欧美国产日韩精品| 亚洲福利视频二区| 久热精品视频| 性做久久久久久久久| 国产精品久久久久久久免费软件| 亚洲精品一线二线三线无人区| 久久综合给合久久狠狠色 | 这里只有精品视频在线| 欧美14一18处毛片| 亚洲国产精品小视频| 久久最新视频| 久久久精品动漫| 国产一区免费视频| 久久国产精品色婷婷| 亚洲无线一线二线三线区别av| 欧美日产国产成人免费图片| 99国产一区二区三精品乱码| 亚洲第一精品电影| 久久一区二区三区超碰国产精品| 国产在线播精品第三| 久久精品一区二区国产| 午夜在线精品偷拍| 国产亚洲一级| 美女视频黄 久久| 久久中文字幕一区| 亚洲国产欧美一区二区三区丁香婷 | 亚欧成人精品| 国产夜色精品一区二区av| 久久精品一二三区| 久久久精品2019中文字幕神马| 伊人久久大香线蕉av超碰演员| 久久这里只精品最新地址| 久久乐国产精品| 亚洲国产成人av在线| 亚洲福利电影| 欧美日韩一区在线播放| 亚洲欧美激情一区二区| 亚洲摸下面视频| 国产亚洲欧美另类中文| 欧美 日韩 国产 一区| 欧美风情在线| 一本久道久久久| 99精品视频一区二区三区| 欧美久久成人| 亚洲欧美日韩国产综合在线 | 蜜臀久久久99精品久久久久久 | 亚洲在线播放| 国产婷婷色综合av蜜臀av| 久久精品夜色噜噜亚洲a∨| 久久亚洲私人国产精品va| 18成人免费观看视频| 欧美黄色一区二区| 欧美国产国产综合| 亚洲网址在线| 久久精品亚洲一区| 亚洲国产精品小视频| 亚洲国产高清一区| 欧美日韩国产一级| 午夜一区二区三视频在线观看| 久久久www成人免费精品| 亚洲电影第1页| 最新日韩在线| 国产精品盗摄久久久| 久久精品免费看| 欧美激情久久久| 亚洲一区二区免费视频| 亚洲免费视频在线观看| 激情成人av| 久久综合久久综合这里只有精品| 欧美激情久久久久久| 亚洲免费一在线| 久久精品国产第一区二区三区| 在线视频成人| 欧美14一18处毛片| 国产精品一区二区你懂得| 久久艳片www.17c.com| 欧美国产亚洲视频| 午夜亚洲性色视频| 亚洲欧美国产va在线影院| 亚洲人成网站在线播| 亚洲在线视频一区| 在线免费高清一区二区三区| 日韩一二在线观看| 国产人成精品一区二区三| 欧美激情成人在线| 国产精品一二三四区| 欧美高清视频www夜色资源网| 欧美日韩免费一区二区三区| 欧美福利视频在线| 国产精品激情电影| 欧美国产高清| 国产伦精品一区二区三区照片91| 蜜桃av久久久亚洲精品| 国产精品午夜在线| 亚洲国产中文字幕在线观看| 国产精品一级二级三级| 亚洲黄页视频免费观看| 国产一区二区三区免费观看| 日韩午夜av| 国产在线视频欧美| 亚洲一区免费在线观看| 亚洲毛片在线免费观看| 久久国产精品免费一区| 亚洲小视频在线观看| 欧美欧美在线| 噜噜噜噜噜久久久久久91| 国产精品红桃| 亚洲国产精品一区二区第四页av| 国内成人精品2018免费看 | 午夜国产精品影院在线观看| 亚洲美女色禁图| 久久精品五月| 久久福利毛片| 国产日韩av在线播放| 99视频精品免费观看| 亚洲高清不卡一区| 久久成人在线| 久久女同互慰一区二区三区| 国产精品视频免费| 日韩一级在线观看| 亚洲精品影视| 欧美日韩国产a| 亚洲国产一区在线观看| 亚洲国产精品久久久| 久久xxxx|