2011年3月23日 星期三

C++ 印出目前函式名稱的方法

#include 
#include 
using namespace std;


int foo(int x)
{
 cout << BOOST_CURRENT_FUNCTION << endl;
 return 0;
}

int main()
{
 cout << BOOST_CURRENT_FUNCTION << endl;
 foo(0);
}

沒有留言:

張貼留言