为了账号安全,请及时绑定邮箱和手机立即绑定

__PRETTY_FUNCTION __,__ FUNCTION __,__ func__

__PRETTY_FUNCTION __,__ FUNCTION __,__ func__

C++ C
BIG阳 2019-08-24 15:10:10
__PRETTY_FUNCTION __,__ FUNCTION __,__ func__之间有什么区别?什么之间的区别__PRETTY_FUNCTION__,__FUNCTION__,__func__,和他们在哪里记录?我如何决定使用哪一个?
查看完整描述

3 回答

?
阿波罗的战车

TA贡献1862条经验 获得超6个赞

尽管没有完全回答原始问题,但这可能是大多数人在谷歌搜索想要看到的。


对于GCC:


petanb@debian:~$ cat test.cpp 

#include <iostream>


int main(int argc, char **argv)

{

    std::cout << __func__ << std::endl

              << __FUNCTION__ << std::endl

              << __PRETTY_FUNCTION__ << std::endl;

}

petanb@debian:~$ g++ test.cpp 

petanb@debian:~$ 

petanb@debian:~$ ./a.out 

main

main

int main(int, char**)


查看完整回答
反对 回复 2019-08-24
  • 3 回答
  • 0 关注
  • 1749 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信