• <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久久精品88| 久久婷婷国产剧情内射白浆| 日本人妻丰满熟妇久久久久久| 91精品国产高清久久久久久io| 国产精品熟女福利久久AV| 亚洲欧美一级久久精品| 久久精品国产亚洲精品2020| 97精品伊人久久久大香线蕉| 色播久久人人爽人人爽人人片aV | 理论片午午伦夜理片久久| 亚洲国产精品综合久久一线 | 69SEX久久精品国产麻豆| 久久电影网| 久久久噜噜噜www成人网| 久久综合久久鬼色| 久久青青草原国产精品免费 | 99久久无码一区人妻a黑| 日批日出水久久亚洲精品tv| 久久久久久久尹人综合网亚洲| 伊人久久国产免费观看视频| 91久久精品视频| 久久99中文字幕久久| 午夜精品久久久久久久久| 性做久久久久久久久| 国产精品成人99久久久久 | 久久香综合精品久久伊人| 草草久久久无码国产专区| 国产精品免费福利久久| 久久伊人精品一区二区三区| 久久综合综合久久综合| 久久一区二区免费播放| 国产精品免费久久| 国产精品久久久天天影视香蕉 | 婷婷久久综合| 久久精品无码一区二区三区日韩| 久久综合丁香激情久久| 国产精品久久网| 97久久精品人人澡人人爽| 久久久精品波多野结衣|