• <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++ 基礎

            久久发布国产伦子伦精品| 久久久久久久亚洲精品| 精品国产乱码久久久久久郑州公司| 精品久久久久久久久免费影院| 国产成人无码精品久久久性色| 无码国内精品久久人妻| 2021久久国自产拍精品| 午夜精品久久久久成人| 精品久久久久久无码中文字幕一区| 久久亚洲国产欧洲精品一| 精品无码久久久久久久久久| 久久亚洲中文字幕精品一区| 日本精品久久久久中文字幕| 无码精品久久一区二区三区| 久久91精品久久91综合| 久久亚洲国产精品成人AV秋霞| 久久国产精品一区二区| 亚洲国产精品成人久久| 久久一区二区免费播放| 日韩欧美亚洲综合久久影院d3| 久久亚洲精品无码aⅴ大香| 9191精品国产免费久久| 99久久久国产精品免费无卡顿 | 国产精品青草久久久久婷婷 | 欧美激情精品久久久久| 亚洲va久久久噜噜噜久久男同 | 国产成人久久精品二区三区| 色狠狠久久AV五月综合| 久久综合久久美利坚合众国| 久久久久久久国产免费看| www亚洲欲色成人久久精品| 国产精品久久亚洲不卡动漫| 日产精品久久久一区二区| 久久人人爽人人爽人人片AV东京热 | 97久久天天综合色天天综合色hd| 久久久久久国产精品美女| 久久午夜综合久久| 欧美日韩中文字幕久久久不卡| 久久久久噜噜噜亚洲熟女综合 | 久久无码专区国产精品发布| 日韩亚洲国产综合久久久|