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

            伊色综合久久之综合久久| 午夜精品久久久久久久无码| 国产精品9999久久久久| 国产99久久久久久免费看| 久久久网中文字幕| 亚洲va国产va天堂va久久| 精品国产乱码久久久久久1区2区| 热久久这里只有精品| 东方aⅴ免费观看久久av| 亚洲综合久久综合激情久久| 亚洲人成精品久久久久| 精品国产青草久久久久福利| 亚洲国产精品18久久久久久| 久久久99精品成人片中文字幕| 亚洲国产精品无码久久98| 久久久久综合国产欧美一区二区| 综合人妻久久一区二区精品| 日本久久中文字幕| 国产成人无码精品久久久久免费| 亚洲精品高清国产一线久久| 久久久精品国产Sm最大网站| 久久久久免费精品国产| 综合网日日天干夜夜久久| 久久99热这里只有精品66| 久久精品亚洲男人的天堂| 91麻豆精品国产91久久久久久 | 99久久婷婷国产综合亚洲| 日本久久中文字幕| 久久久久99精品成人片牛牛影视| 99久久国产热无码精品免费久久久久| 伊人久久综合无码成人网| 久久久久久精品久久久久| 亚洲综合久久夜AV | 中文字幕无码久久人妻| 久久99热这里只频精品6| 久久久久久免费视频| 2021国产精品久久精品| 亚洲精品蜜桃久久久久久| 久久久久久夜精品精品免费啦| 国产精品免费福利久久| 国产一级持黄大片99久久|