求一个调用语句
A类中有void b(int)方法,非静态的.
如何在A a中调用一个全局函数 void c(pFunc p);
已知有定义 typedef int (*pFunc)(int i);
要把A::b作为参数传入c
我只会用非对象的函数指针,如果这个函数是对象函数就没辙了
无码无真相:
class A { public: void b(int i); void yourTest();}typedef int (*pFunc)(int i);void c(const char * file , pFunc p);void A::yourTest(){ const char * file = "test.txt"; c(file ,&(this->b));//我写了这样不行,求大神}