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

            woaidongmao

            文章均收錄自他人博客,但不喜標(biāo)題前加-[轉(zhuǎn)貼],因其丑陋,見(jiàn)諒!~
            隨筆 - 1469, 文章 - 0, 評(píng)論 - 661, 引用 - 0
            數(shù)據(jù)加載中……

            #line 宏

            用來(lái)重新設(shè)定源文件的名字和行號(hào),指向另外的一個(gè)地方,如果出現(xiàn)編譯錯(cuò)誤,編譯器的輸出信息將指向設(shè)置后的文件和偏移, LEX & YACC,Ragel,很多這種宏。

             

            MSDN的解釋

            The #line directive tells the preprocessor to change the compiler’s internally stored line number and filename to a given line number and filename. The compiler uses the line number and filename to refer to errors that it finds during compilation. The line number usually refers to the current input line, and the filename refers to the current input file. The line number is incremented after each line is processed.

            Syntax

            #line

            digit-sequence "filename"opt

            The digit-sequence value can be any integer constant. Macro replacement can be performed on the preprocessing tokens, but the result must evaluate to the correct syntax. The filename can be any combination of characters and must be enclosed in double quotation marks (" "). If filename is omitted, the previous filename remains unchanged.

            You can alter the source line number and filename by writing a #line directive. The translator uses the line number and filename to determine the values of the predefined macros __FILE__ and __LINE__. You can use these macros to insert self-descriptive error messages into the program text. For more information on these predefined macros, see Predefined Macros.

            The __FILE__ macro expands to a string whose contents are the filename, surrounded by double quotation marks (" ").

            If you change the line number and filename, the compiler ignores the previous values and continues processing with the new values. The #line directive is typically used by program generators to cause error messages to refer to the original source file instead of to the generated program.

            The following examples illustrate #line and the __LINE__ and __FILE__ macros.

            In this statement, the internally stored line number is set to 151 and the filename is changed to copy.c.

            #line 151 "copy.c"

            In this example, the macro ASSERT uses the predefined macros __LINE__ and __FILE__ to print an error message about the source file if a given “assertion” is not true.

            #define ASSERT(cond)
             
            if( !(cond) )\
            {printf( "assertion error line %d, file(%s)\n", \
            __LINE__, __FILE__ );}

             

            posted on 2008-12-27 22:26 肥仔 閱讀(830) 評(píng)論(0)  編輯 收藏 引用 所屬分類: C++ 基礎(chǔ)

            久久天堂AV综合合色蜜桃网| 日韩人妻无码精品久久久不卡| 精品一久久香蕉国产线看播放| 久久成人小视频| 人妻无码中文久久久久专区| 久久AAAA片一区二区| 久久妇女高潮几次MBA| 久久久久免费精品国产| 久久精品国产免费观看| 久久嫩草影院免费看夜色| 久久亚洲国产成人精品性色| 无码任你躁久久久久久| 一级做a爰片久久毛片16| 奇米影视7777久久精品| 亚洲国产综合久久天堂| 成人a毛片久久免费播放| 久久精品九九亚洲精品| 久久婷婷五月综合国产尤物app| 九九热久久免费视频| 久久国产亚洲高清观看| 模特私拍国产精品久久| 国内精品久久久久久久亚洲 | 色诱久久久久综合网ywww| 久久国产综合精品五月天| 久久精品www| 久久91精品国产91久久小草 | 嫩草伊人久久精品少妇AV| 99久久做夜夜爱天天做精品| 久久人妻少妇嫩草AV无码蜜桃 | 国产精品久久久久久影院| 一本色道久久88—综合亚洲精品| 波多野结衣久久一区二区| 亚洲日本久久久午夜精品| 久久久久人妻一区二区三区| 亚洲国产精品成人久久蜜臀| 无码人妻久久一区二区三区蜜桃| 久久人人爽人人澡人人高潮AV| 久久精品成人影院| 亚洲欧美国产日韩综合久久| 久久久久久久精品妇女99| 日韩人妻无码精品久久免费一|