Using #line directive

Discussion in 'ASP .Net' started by AA, Nov 30, 2006.

  1. AA

    AA Guest

    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
     
    AA, Nov 30, 2006
    #1
    1. Advertising

  2. Hello AA,

    How do u print the current file?

    A> Hi,
    A> I have a C++ project in DOT NET. I am using the __FILE__ and
    A> __LINE__
    A> to print the current file and line number. I do not want the file
    A> anem
    A> with the full path to be printed. So I used the #line directive.
    A>
    A>
    Code:
    A> 
    A> #line 3 "11.cpp"
    A> 
    A> 
    A>
    A> Still the full file name along with the name (11.c) gets printed. If
    A> I change 11.c above and type something else, say trial.cpp, the full
    A> file path along with trial.cpp gets printed. How can I just get the
    A> file name printed using __FILE__?
    A>
    A> Regards,
    A> AA
    ---
    WBR,
    Michael Nemtsev [C# MVP] :: blog: http://spaces.live.com/laflour

    "At times one remains faithful to a cause only because its opponents do not
    cease to be insipid." (c) Friedrich Nietzsche
     
    Michael Nemtsev, Dec 1, 2006
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. M. Uli Kusterer

    Equivalent to C's #line directive?

    M. Uli Kusterer, Sep 20, 2004, in forum: Java
    Replies:
    5
    Views:
    493
    Daniel Bonniot
    Sep 21, 2004
  2. Mantorok Redgormor

    line directive

    Mantorok Redgormor, Nov 16, 2003, in forum: C Programming
    Replies:
    2
    Views:
    330
    Sidney Cadot
    Nov 16, 2003
  3. Pawel

    #line directive makes gdb crazy ?

    Pawel, Jan 12, 2007, in forum: C Programming
    Replies:
    3
    Views:
    622
    Kenneth Brody
    Jan 15, 2007
  4. AA

    Using #line directive

    AA, Nov 30, 2006, in forum: C++
    Replies:
    0
    Views:
    361
  5. Alf P. Steinbach

    Re: Using #line directive

    Alf P. Steinbach, Nov 30, 2006, in forum: C++
    Replies:
    1
    Views:
    328
    Richard Heathfield
    Nov 30, 2006
Loading...

Share This Page