AgPro

导航

#line的作用

#line

Syntax:

  #line line_number "filename"

The #line command is simply used to change the value of the __LINE__ and __FILE__ variables. The filename is optional. The __LINE__ and __FILE__ variables represent the current file and which line is being read. The command

  #line 10 "main.cpp"                

changes the current line number to 10, and the current file to "main.cpp".

 

cout << __LINE__ << endl;

posted on 2010-06-11 15:03  AgPro  阅读(523)  评论(0编辑  收藏  举报