Using #line directive

A

AA

Hi,
I have a C++ project in DOT NET. I am using the __FILE__ and __LINE__
to print the current file and line number. I do not want the file anem
with the full path to be printed. So I used the #line directive.

Code:
#line 3 "11.cpp"

Still the full file name along with the name (11.c) gets printed. If I
change 11.c above and type something else, say trial.cpp, the full file
path along with trial.cpp gets printed. How can I just get the file
name printed using __FILE__?

Regards,
AA
 
D

David Lowndes

I have a C++ project in DOT NET. I am using the __FILE__ and __LINE__
to print the current file and line number. I do not want the file anem
with the full path to be printed.

Have a look at the /FC compiler switch.

Dave
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top