• <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 肥仔 閱讀(835) 評論(0)  編輯 收藏 引用 所屬分類: C++ 基礎

            久久久免费观成人影院 | 91精品国产综合久久精品| 亚洲国产精品无码久久98| 97久久国产亚洲精品超碰热| 日本福利片国产午夜久久| 久久婷婷色香五月综合激情 | 欧美日韩久久中文字幕| 久久国产免费观看精品| 久久99精品国产麻豆宅宅| 韩国三级中文字幕hd久久精品 | 国产三级精品久久| 亚洲综合伊人久久综合| 99热精品久久只有精品| 久久亚洲精精品中文字幕| 香蕉99久久国产综合精品宅男自| 亚洲国产精品成人久久| 一本色道久久88综合日韩精品 | 国产99久久精品一区二区| 久久人妻少妇嫩草AV无码蜜桃| 国产精品久久婷婷六月丁香| 狠狠干狠狠久久| 久久婷婷五月综合97色一本一本| 精品久久久久久无码中文字幕| 狠狠色丁香久久婷婷综合五月| 欧美日韩久久中文字幕| 欧洲性大片xxxxx久久久| 99热热久久这里只有精品68| 久久精品国产亚洲沈樵| 精品久久久久久中文字幕| 久久精品人人做人人妻人人玩| 99久久香蕉国产线看观香| 久久久亚洲精品蜜桃臀| 理论片午午伦夜理片久久| 久久久无码精品午夜| 色婷婷久久久SWAG精品| 久久中文字幕视频、最近更新 | 青青草原综合久久大伊人精品| 国产精品久久久久9999高清| 久久91亚洲人成电影网站| 国产激情久久久久影院小草| 久久精品中文字幕有码|