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

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

            paster( 
            9 ); 

            宏被展開為 

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

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

            91精品免费久久久久久久久| 粉嫩小泬无遮挡久久久久久| 伊人伊成久久人综合网777| 青青热久久国产久精品| 国产美女亚洲精品久久久综合| 久久精品国产亚洲av麻豆图片| 热re99久久6国产精品免费| 国产一区二区精品久久| 亚洲?V乱码久久精品蜜桃| 亚洲女久久久噜噜噜熟女| 99久久久精品免费观看国产| 久久久久香蕉视频| 精品永久久福利一区二区| 丁香五月综合久久激情| 人妻精品久久久久中文字幕69 | 欧美久久久久久| 国内精品久久久久影院日本| 欧美久久亚洲精品| 久久精品国产亚洲沈樵| 欧洲成人午夜精品无码区久久| 人妻中文久久久久| 国产 亚洲 欧美 另类 久久 | 国产精品日韩欧美久久综合| 久久99国产综合精品女同| 一本久久a久久精品综合香蕉| 色综合久久久久| 中文字幕亚洲综合久久2| 久久精品亚洲日本波多野结衣| 久久久久亚洲AV成人网人人网站| 国产V亚洲V天堂无码久久久| 亚洲欧美成人综合久久久| 久久久久久精品无码人妻| 色欲综合久久躁天天躁| 久久久久国产精品三级网| 91精品国产色综久久| 亚洲国产精品久久| 国产一级持黄大片99久久| 国产91色综合久久免费分享| 久久香综合精品久久伊人| 欧美噜噜久久久XXX| 国产精品一久久香蕉国产线看观看 |