如果我有:
class MyClass {
...... my code....
private:
void myFunction(int p);
}
in cpp file:
MyClass::MyClass() {
void (*pointer)(int);
pointer = &myFunction;
}
MyClass::myFunction(int p) {
//.... my code .... //
}
这可能吗?我有一个分配问题:
cannot convert 'void(MyClass::*)(int)' to 'void (*)(int)' in assignment