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

隨筆 - 45  文章 - 129  trackbacks - 0
<2025年12月>
30123456
78910111213
14151617181920
21222324252627
28293031123
45678910

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

常用鏈接

留言簿(10)

隨筆分類

隨筆檔案

相冊

朋友

  • .NET

搜索

  •  

最新評論

閱讀排行榜

評論排行榜

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

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

#的用法

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&&設計模式小屋 閱讀(1658) 評論(1)  編輯 收藏 引用 所屬分類: 其他

FeedBack:
# re: 關于 ## ,#以及#@的用法 2007-04-21 18:47 heweitykc
c++整的這么復雜啊 以后怎么維護啊!  回復  更多評論
  
青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品
  • <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>
              国产区精品在线观看| 国产免费成人在线视频| 亚洲国产成人tv| 欧美大片在线看| 欧美激情在线| 亚洲欧美精品一区| 亚洲女性喷水在线观看一区| 国产精品稀缺呦系列在线| 欧美三区在线观看| 亚洲一区二区三区在线视频| 中文av字幕一区| 国产视频在线一区二区| 麻豆国产va免费精品高清在线| 久久亚洲图片| 亚洲最新视频在线播放| 亚洲男女自偷自拍| 在线观看亚洲专区| 亚洲美女视频在线观看| 久久久夜夜夜| 亚洲乱码国产乱码精品精| 一区二区三区日韩| 国产亚洲欧美激情| 亚洲自拍另类| 久久亚洲风情| 亚洲欧美制服中文字幕| 久久综合久久综合久久综合| 一区二区三区精密机械公司| 欧美一站二站| 一区二区三区久久精品| 欧美一区亚洲二区| 日韩视频永久免费| 欧美中在线观看| 亚洲小说区图片区| 久热这里只精品99re8久| 在线一区二区三区四区五区| 久久成人这里只有精品| 亚洲在线免费观看| 欧美成人午夜激情在线| 久久精品道一区二区三区| 欧美激情在线狂野欧美精品| 久久久在线视频| 国产精品美女999| 91久久久久| 永久免费精品影视网站| 亚洲一级黄色| 亚洲一区在线观看免费观看电影高清| 欧美尤物一区| 亚洲欧美日韩在线高清直播| 欧美激情一区二区三区不卡| 久久免费高清视频| 国产美女扒开尿口久久久| 亚洲精品一区二区三区不| ●精品国产综合乱码久久久久| 午夜精品电影| 欧美一区二区三区婷婷月色| 亚洲一线二线三线久久久| 亚洲伦理中文字幕| 老司机免费视频久久| 久久女同互慰一区二区三区| 国产精品亚洲欧美| 亚洲图片欧洲图片日韩av| 一区二区三区欧美在线观看| 欧美精品二区三区四区免费看视频| 老司机凹凸av亚洲导航| 国内精品美女av在线播放| 亚洲午夜羞羞片| 亚洲欧美国产高清va在线播| 欧美日韩你懂的| 亚洲精品视频免费| 一区二区不卡在线视频 午夜欧美不卡在 | 欧美区视频在线观看| 欧美激情在线观看| 亚洲另类视频| 国产精品h在线观看| 一本久久综合亚洲鲁鲁| 亚洲自拍啪啪| 国产一区二区三区日韩欧美| 销魂美女一区二区三区视频在线| 欧美一区二区三区四区在线观看| 国产欧美日本一区二区三区| 欧美一级播放| 老司机午夜精品视频在线观看| 在线免费日韩片| 欧美激情一区在线| 亚洲视频免费观看| 久久久www成人免费精品| 国产综合欧美在线看| 乱中年女人伦av一区二区| 欧美激情第三页| 亚洲线精品一区二区三区八戒| 国产精品免费久久久久久| 性18欧美另类| 亚洲第一网站| 午夜精品久久久久久99热| 好吊成人免视频| 欧美大片网址| 午夜精品一区二区三区电影天堂| 美腿丝袜亚洲色图| 一本色道久久综合亚洲精品婷婷| 国产精品丝袜91| 欧美 日韩 国产一区二区在线视频 | 亚洲欧洲在线视频| 亚洲欧美一区二区三区久久| 国产资源精品在线观看| 欧美成人精品在线观看| 国产精品99久久久久久久久 | 一本久久a久久精品亚洲| 国产精品露脸自拍| 欧美aⅴ99久久黑人专区| 中文精品一区二区三区| 欧美顶级艳妇交换群宴| 亚洲欧美偷拍卡通变态| 亚洲精品一区二区三区四区高清| 国产精品久久久久久影院8一贰佰 国产精品久久久久久影视 | 亚洲欧美亚洲| 亚洲美女黄网| 曰本成人黄色| 国产日韩欧美视频| 欧美日韩精品一区二区天天拍小说 | 欧美国产欧美综合| 欧美尤物一区| 亚洲一区视频在线观看视频| 最近中文字幕日韩精品 | 久久亚洲精品一区二区| 欧美大片免费观看| 久久精品视频在线播放| 亚洲欧美日韩第一区| 日韩一区二区高清| 亚洲福利视频免费观看| 麻豆成人在线播放| 久久久久久久久久看片| 亚洲女优在线| 亚洲一区在线免费| 亚洲午夜精品国产| 在线视频欧美日韩| 一区二区三区精品| 夜夜狂射影院欧美极品| 亚洲国产精品免费| 亚洲电影免费观看高清完整版在线| 国产三区精品| 国产一区91| 国语自产精品视频在线看抢先版结局| 国产精品久久久久久影院8一贰佰| 欧美日韩亚洲一区二区三区四区| 欧美激情一区二区| 欧美另类变人与禽xxxxx| 欧美国产另类| 欧美日韩国产精品自在自线| 欧美日韩国产亚洲一区| 欧美日韩精品免费在线观看视频| 欧美日韩第一区日日骚| 欧美日韩精品在线视频| 欧美午夜免费| 国产乱子伦一区二区三区国色天香 | 亚洲一区二区三区乱码aⅴ蜜桃女| 夜夜嗨av色综合久久久综合网| 日韩一级黄色大片| 亚洲男人的天堂在线aⅴ视频| 亚洲图片自拍偷拍| 久久aⅴ国产紧身牛仔裤| 久久久中精品2020中文| 欧美成人xxx| 欧美日韩国产色站一区二区三区| 欧美日韩在线三级| 国产小视频国产精品| 一区二区视频欧美| 亚洲美女电影在线| 亚洲欧美日韩国产一区| 久久青草欧美一区二区三区| 欧美承认网站| a4yy欧美一区二区三区| 欧美在线观看天堂一区二区三区| 久久综合久色欧美综合狠狠| 欧美精品久久久久久久| 国产精品亚洲综合久久| 在线免费观看视频一区| 亚洲午夜女主播在线直播| 久久久久久久999精品视频| 亚洲国产日韩精品| 亚洲一区二区三区高清| 另类激情亚洲| 国产精品入口麻豆原神| 亚洲激情视频在线观看| 午夜一区在线| 亚洲三级免费| 久久精品国产久精国产爱| 欧美日韩福利视频| 狠狠综合久久| 午夜国产精品影院在线观看 | 久久精品国产一区二区三区| 欧美韩国日本综合| 欧美亚洲系列| 欧美日韩一区二区在线| 在线日韩av| 久久精品1区| avtt综合网| 欧美高清视频一区| 尤物精品国产第一福利三区 | 一区在线影院| 香蕉久久久久久久av网站|