Join Now
Quality Rating:
  • Currently 0.0 / 5
(0.0 / 5 - 0 votes cast)
Expertise Level:
  • Currently 0.0 / 5
(0.0 / 5 - 0 votes cast)

This page was last modified 10:38, 2 July 2007.

如何获取当前函数的名称

From Forum Nokia Wiki

  • 设备, 软件 版本:

S60 3rd Edition


  • 详细描述:

有时候debug时为了记录相关信息,我们需要知道当前函数的名称,这时可以通过__func__来获取。

void LogFunctionName(const char* name)
    {
        RDebug::Printf("current function: %s\n", name);
    }


现在,我们可以通过如下语句打印出函数名:

LogFunctionName(__func__);
 
Powered by MediaWiki
     
     RDF Facets:
     
     
     qfnZtypeQUqfnTypeZCommunityContentQ
     qfnZtypeQUqfnTypeZWebpageQ
     qfnZtypeQUqfnTypeZWikiContentQ
     qmarsZlanguageQUxhttpE3aE2fE2fswE2enokiaE2ecomE2flanguageE2d1E2fenX