Visual C++ equivalent of __FILE__ , __LINE__ and __PRETTY_FUNCTION__

后端 未结 8 2247
后悔当初
后悔当初 2020-12-14 08:50

GCC compiler gives me the following macros:

  • __FILE__ so that I can print out the file name + directory.
  • __LINE__ so that I c
8条回答
  •  天涯浪人
    2020-12-14 09:25

    1. Yes, Microsoft Visual Studio has __FILE__ and __LINE__. Here are more MSVC macros.

    2. Both are ANSI C++.

    3. MSVC has __FUNCTION__, which is Microsoft-specific.

提交回复
热议问题