• <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++博客 ::  :: 新隨筆 :: 聯(lián)系 :: 聚合  :: 管理

            #define 指令

            Posted on 2008-09-14 16:56 沒畫完的畫 閱讀(223) 評論(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" ); 
            }
             

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


            程序運(yùn)行結(jié)果如下:
            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); 

            這條語句將被擴(kuò)展為 

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

            3、連接符(Token-Pasting Opertor)

            ##

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

            如果一個(gè)數(shù)字作為此宏的參數(shù)調(diào)用的話, 

            paster( 
            9 ); 

            宏被展開為 

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

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

            亚洲国产成人精品91久久久 | 久久亚洲精品无码aⅴ大香| 精品一久久香蕉国产线看播放| 久久青青草原精品国产软件| 久久久久久亚洲AV无码专区| 久久国产欧美日韩精品| 亚洲精品无码久久毛片 | 国产精品无码久久久久| 久久成人国产精品| 久久伊人五月天论坛| 99re这里只有精品热久久| 久久婷婷五月综合国产尤物app| 久久精品国产亚洲AV久| 国产精品丝袜久久久久久不卡| 亚洲人成精品久久久久| 国产高潮久久免费观看| 97久久国产露脸精品国产| 久久国产香蕉视频| 久久这里有精品视频| 久久青草国产手机看片福利盒子| 久久精品国产亚洲一区二区| 精品999久久久久久中文字幕| 久久久久久久91精品免费观看 | 精品久久人人爽天天玩人人妻 | 久久精品国产亚洲AV蜜臀色欲| 久久国产香蕉视频| 99久久精品国产一区二区蜜芽| 国产激情久久久久影院小草| 97精品久久天干天天天按摩| 精品国产乱码久久久久久郑州公司| 国产精品一久久香蕉产线看| 一本一本久久a久久综合精品蜜桃| 欧美伊人久久大香线蕉综合| 日韩久久久久中文字幕人妻 | 日本精品久久久中文字幕| 高清免费久久午夜精品| 国产日产久久高清欧美一区| 精品999久久久久久中文字幕| 精品久久久久久久| 青青草国产成人久久91网| 久久AⅤ人妻少妇嫩草影院|