Hi everyone, it's hard days to understand deeper about function pointer, now i get trouble with that, i need your help, and i very pleasure to know what's wrong i've made. thanks a lot.
Code:
#include <iostream>
using namespace std;
class one {
public:
static void show() { cout << "Hi" << endl; }
};
int main() {
static void (one::*f)();
f = &one::show;
one oo;
(oo.*f)();
return 0;
}
//output:
//1.cc: In function ‘int main()’:
//1.cc:9: error: cannot convert ‘void (*)()’ to ‘void (one::*)()’ in assignment