64,663
社区成员
发帖
与我相关
我的任务
分享
class Test
{
int a;
public:
Test(int a){this->a = a;}
void display();
};
void Test::display()
{
cout << a << endl;
}
int main(void)
{
Test test(2);
void (Test::*pFun)(void);
pFun = &Test::display;
(test.*pFun)();
}