• <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 沒畫完的畫 閱讀(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" ); 
            }
             

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

            亚洲AV无一区二区三区久久| 久久伊人精品青青草原高清| 2021国产精品久久精品| 一本色道久久88精品综合| jizzjizz国产精品久久| 国产高潮国产高潮久久久91| 亚洲国产成人久久综合野外| av国内精品久久久久影院| 亚洲国产成人久久综合野外| 色综合久久久久网| 亚洲午夜久久久久妓女影院| 精品无码久久久久久国产| 99久久免费国产特黄| 色婷婷综合久久久久中文字幕 | 2021久久精品免费观看| 青青草原综合久久大伊人精品| 亚洲日本久久久午夜精品| 国产成人香蕉久久久久| aaa级精品久久久国产片| 亚洲色欲久久久综合网| 人妻无码精品久久亚瑟影视| 狠狠精品久久久无码中文字幕 | 国内精品久久久久久中文字幕| 久久久久久久亚洲Av无码| 亚洲乱码精品久久久久..| 色婷婷综合久久久久中文字幕| 91精品国产91热久久久久福利| 精品久久久久久无码专区不卡 | 97超级碰碰碰久久久久| 久久婷婷国产综合精品| 无码日韩人妻精品久久蜜桃 | 久久精品国产欧美日韩99热| 久久久久久久国产免费看| 久久www免费人成看国产片 | 色综合久久无码中文字幕| 亚洲日本va中文字幕久久| 久久妇女高潮几次MBA| 亚洲AV日韩精品久久久久久| 久久久久久九九99精品| 麻豆精品久久精品色综合| 精品久久久无码中文字幕|