Visual C++ equivalent of __FILE__ , __LINE__ and __PRETTY_FUNCTION__

后端 未结 8 2266
后悔当初
后悔当初 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:41

    Yes Visual C++ has them or an equivalent. See the responses here:

    What's the difference between __PRETTY_FUNCTION__, __FUNCTION__, __func__? function-func/4384860#4384860

    Also note that despite the upper case used, they aren't macros. They're variables.

提交回复
热议问题