C++类成员的函数指针
#include <iostream>
using namespace std;
class TTest
{
public:
void (TTest::*pfun)(void);
void test();
void fun(void);
};
void TTest::fun()
{
cout << "TTest::fun()" << endl;
}
void TTest::test()
{
pfun = &TTest::fun;
(this->*pfun)();
}
int main()
{
TTest* t=new TTest();
t->fun();
t->test();
delete t;
int wait;
cin >> wait;
return 0;
}