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

            精品国产乱码久久久久久浪潮 | 7777精品久久久大香线蕉| 欧美久久一区二区三区| 久久天天躁夜夜躁狠狠躁2022| 国产亚洲美女精品久久久2020| 精品久久久久久亚洲精品| 国产精品亚洲综合专区片高清久久久 | 国产激情久久久久影院| 亚洲精品无码久久不卡| 中文精品久久久久国产网址| 热久久视久久精品18| 亚洲国产成人久久综合碰碰动漫3d| 婷婷久久综合| 久久精品国产半推半就| 久久99国产精品久久99小说| 国产午夜精品理论片久久影视| 99久久做夜夜爱天天做精品| 久久免费高清视频| 久久妇女高潮几次MBA| 久久精品无码一区二区app| 久久精品国产亚洲AV麻豆网站 | 久久久久香蕉视频| 国产精品久久99| 亚洲精品蜜桃久久久久久| 久久国产高清一区二区三区| 丁香五月网久久综合| 久久综合久久自在自线精品自| 国内精品伊人久久久久妇| 精品久久久久久无码中文野结衣| 97久久超碰成人精品网站| 精品久久无码中文字幕| 亚洲精品乱码久久久久久蜜桃不卡 | 国产精品久久久久影院嫩草| 亚洲精品国产第一综合99久久| 久久99久久成人免费播放| 伊人色综合久久天天| 国产精品免费看久久久香蕉| 久久777国产线看观看精品| 久久精品国产99国产精偷| 国产午夜精品理论片久久 | 久久久无码精品亚洲日韩京东传媒|