• <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>

            沒畫完的畫

            喂馬 劈柴 BBQ~
            posts - 37, comments - 55, trackbacks - 0, articles - 0
              C++博客 ::  :: 新隨筆 :: 聯系 :: 聚合  :: 管理

            #define 指令

            Posted on 2008-09-14 16:56 沒畫完的畫 閱讀(214) 評論(0)  編輯 收藏 引用 所屬分類: VC

            1、字符串化(Stringizing Operator)

            #

            #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" ); 
            }
             

            如此的定義在進行處理時將被轉換為如下代碼:
            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" );
            }


            程序運行結果如下:
            In quotes 
            in the printf function call 
            "In quotes when printed to the screen" 
            "This: \" prints an escaped double quotation mark" 


            2、字符化(Charizing Operator)

            #@

            例子:#define makechar(x) #@x 

            causes the statementa 
            = makechar(b); 

            這條語句將被擴展為 

            = 'b';注意單引號字符不能使用這樣的字符化。  

            3、連接符(Token-Pasting Opertor)

            ##

            #define paster( n ) printf( "token" #n " = %d", token##n ) int token9 = 9; 

            如果一個數字作為此宏的參數調用的話, 

            paster( 
            9 ); 

            宏被展開為 

            printf( 
            "token" "9" " = %d", token9 ); 

            進而成為這樣的語句:printf( 
            "token9 = %d", token9 );  

            97久久精品无码一区二区| 亚洲AV无码一区东京热久久| www久久久天天com| 亚洲国产精品热久久| 日韩精品无码久久一区二区三| 久久精品国产久精国产一老狼| 亚洲AV无码1区2区久久| 国产精品久久99| 少妇无套内谢久久久久| 国产午夜精品理论片久久影视| 一级做a爰片久久毛片免费陪| 久久精品人人做人人爽电影蜜月| 久久久久人妻一区精品| 国产亚洲欧美精品久久久| 精品国产91久久久久久久a| 亚洲人成精品久久久久 | 91精品免费久久久久久久久| 一本久久a久久精品综合香蕉| 久久福利青草精品资源站免费| 精品久久久久久无码不卡| 香蕉久久一区二区不卡无毒影院| 久久久久亚洲AV成人网人人网站 | 中文字幕久久精品| 国产精品久久久久久久久鸭| 亚洲日本va中文字幕久久| 亚洲精品tv久久久久久久久久| 国产免费久久久久久无码| 久久久久夜夜夜精品国产| 久久精品国产亚洲av水果派| 女人高潮久久久叫人喷水| 久久精品综合一区二区三区| 久久这里只精品国产99热| 久久精品国产久精国产| av无码久久久久不卡免费网站| 亚洲精品乱码久久久久久久久久久久 | 久久99精品免费一区二区 | 色8激情欧美成人久久综合电| 国产亚洲色婷婷久久99精品91 | 国産精品久久久久久久| 久久精品嫩草影院| 91亚洲国产成人久久精品网址|