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

            文章均收錄自他人博客,但不喜標題前加-[轉貼],因其丑陋,見諒!~
            隨筆 - 1469, 文章 - 0, 評論 - 661, 引用 - 0
            數據加載中……

            #line 宏

            用來重新設定源文件的名字和行號,指向另外的一個地方,如果出現編譯錯誤,編譯器的輸出信息將指向設置后的文件和偏移, 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 肥仔 閱讀(825) 評論(0)  編輯 收藏 引用 所屬分類: C++ 基礎

            成人资源影音先锋久久资源网| 久久久这里有精品| 69久久夜色精品国产69| 久久亚洲精品视频| 久久se这里只有精品| 久久久久亚洲av无码专区导航| 久久亚洲国产午夜精品理论片 | 亚洲综合久久夜AV | 亚洲国产精品久久久天堂| 久久综合狠狠综合久久激情 | 漂亮人妻被黑人久久精品| 久久美女网站免费| 精品久久亚洲中文无码| 久久久青草久久久青草| 三级三级久久三级久久| 成人资源影音先锋久久资源网| 性高朝久久久久久久久久| 久久国产精品-国产精品| 狠狠色丁香婷婷久久综合| 久久精品国产免费一区| 人妻精品久久无码专区精东影业| 国产精品xxxx国产喷水亚洲国产精品无码久久一区| 日韩影院久久| 国产精品久久久久久久午夜片| 久久国产精品无码HDAV| 亚洲第一永久AV网站久久精品男人的天堂AV | 久久久久97国产精华液好用吗| 亚洲AV日韩精品久久久久久| 国产亚洲美女精品久久久 | 久久精品国产影库免费看| 亚洲精品无码久久久久sm| 香蕉久久久久久狠狠色| 久久国产午夜精品一区二区三区| 国产精品久久久久久吹潮| 日本久久久久亚洲中字幕| 亚洲精品tv久久久久久久久| 亚洲精品美女久久777777| 伊人久久大香线蕉亚洲| 久久这里都是精品| 一本久道久久综合狠狠躁AV| 久久久久国产一区二区三区|