• <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 沒畫完的畫 閱讀(221) 評論(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; 

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

            paster( 
            9 ); 

            宏被展開為 

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

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

            国产99精品久久| 久久久久av无码免费网| 亚洲中文久久精品无码ww16| 久久精品国产亚洲Aⅴ香蕉| 99久久免费国产精品热| 久久久精品午夜免费不卡| 久久精品国产亚洲av麻豆小说| 亚洲综合伊人久久大杳蕉| 婷婷伊人久久大香线蕉AV | 久久精品国产亚洲77777| 一本色道久久综合狠狠躁| 亚洲精品国产美女久久久 | 亚洲狠狠婷婷综合久久蜜芽| 伊人久久大香线蕉综合Av| 亚洲精品乱码久久久久久蜜桃图片 | 97精品伊人久久大香线蕉app| 久久婷婷国产综合精品| 久久香蕉国产线看观看99| 精品久久久久久久久久中文字幕 | 日本久久久久久中文字幕| 99久久婷婷国产综合精品草原| 国产精品久久国产精麻豆99网站| 久久午夜电影网| 伊人 久久 精品| 精品久久8x国产免费观看| 久久九九亚洲精品| 一97日本道伊人久久综合影院| 久久婷婷五月综合色奶水99啪| 国产日韩久久久精品影院首页| 久久午夜免费视频| 国产精品久久自在自线观看| 欧美激情精品久久久久久| 久久精品九九亚洲精品| 久久精品国产一区二区| 久久免费的精品国产V∧| 精品久久久久久99人妻| 久久精品国产精品亚洲毛片 | 亚洲国产精品久久久久久| 99久久国产精品免费一区二区 | 热久久这里只有精品| 亚洲国产精品高清久久久|