What's the meaning of #line in C language?

前端 未结 6 1715
借酒劲吻你
借酒劲吻你 2021-02-01 03:27

What\'s the meaning of #line in the C language? Where would it be used?

6条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-02-01 04:00

    It is a pragma keyword:

    "#line lets you modify the compiler's line number and (optionally) the file name output for errors and warnings. This example shows how to report two warnings associated with line numbers. The #line 200 directive forces the line number to be 200 (although the default is #7) and until the next #line directive, the filename will be reported as "Special". The #line default directive returns the line numbering to its default numbering, which counts the lines that were renumbered by the previous directive."

提交回复
热议问题