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

            国产精品日韩深夜福利久久| 精品久久久久久国产| 99久久精品国产毛片| 狠色狠色狠狠色综合久久| 精品人妻伦一二三区久久| 亚洲色婷婷综合久久| 久久久这里有精品中文字幕| 亚洲精品无码久久千人斩| 久久国产综合精品五月天| 一本色道久久99一综合| 久久国产综合精品五月天| 久久久精品2019免费观看| 久久夜色精品国产噜噜亚洲a| 亚洲国产精品无码久久98| 久久久国产一区二区三区| 成人久久精品一区二区三区| 蜜桃麻豆WWW久久囤产精品| 国产免费久久精品丫丫| 国产精品久久波多野结衣| 久久人妻AV中文字幕| 少妇久久久久久被弄到高潮| 久久精品嫩草影院| 久久精品国产亚洲av日韩| 久久久www免费人成精品| 精品久久久无码中文字幕天天| 69久久夜色精品国产69| 久久婷婷五月综合97色 | 一本久久a久久精品亚洲| 久久精品国产黑森林| 狠狠人妻久久久久久综合蜜桃| 久久91精品国产91久久麻豆| 九九久久自然熟的香蕉图片| 日韩精品久久久久久久电影蜜臀| 综合久久国产九一剧情麻豆| 影音先锋女人AV鲁色资源网久久| 99久久综合国产精品免费| 久久精品中文无码资源站| 亚洲AV日韩精品久久久久久久 | 97久久精品无码一区二区| 狠狠色婷婷综合天天久久丁香| 久久99热国产这有精品|