CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    George2 is offline Elite Member Power Poster
    Join Date
    Oct 2002
    Posts
    4,468

    Unhappy What is the function of __FILE__ and __LINE__?

    Hi, everyone!

    What is the meaning of __FILE__ and __LINE__ in the following code?

    sprintf (s, "_Assert: %s, %d",__FILE__, __LINE__ )

    Another question, where is the two variable defined?
    Are they compile system variable?

    Thanks in advance.
    George

  2. #2
    Join Date
    Sep 2002
    Posts
    1,747
    They are preprocessor defined variables (and a part of the c++ standard) that mean exactly what they say. They transform after preprocessing to the line integer and the file name string. They are useful in debugging (which is what the sprintf is doing).
    */*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/

    "It's hard to believe in something you don't understand." -- the sidhi X-files episode

    galathaea: prankster, fablist, magician, liar

  3. #3
    George2 is offline Elite Member Power Poster
    Join Date
    Oct 2002
    Posts
    4,468

    Talking

    Thanks!

    George
    Originally posted by galathaea
    They are preprocessor defined variables (and a part of the c++ standard) that mean exactly what they say. They transform after preprocessing to the line integer and the file name string. They are useful in debugging (which is what the sprintf is doing).

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured