You mean like this?
Code:
#include <iostream>
using namespace std;
class CFoo
{
public:
void func1() { cout << "func1 for CFoo at " << this << endl; }
void func2() { cout << "func2 for CFoo at " << this << endl; }
};
typedef void (CFoo::*FooMethod)();
int main()
{
FooMethod methods[2];
methods[0] = &CFoo::func1;
methods[1] = &CFoo::func2;
CFoo foo;
(foo.*methods[0])();
(foo.*methods[1])();
return 0;
}
What's up with the double spacing on that? I don't know.