P
Protoman
Why doesn't this code work; it should:
class Obj
{
public:
void a(){cout << "A!" << endl;}
void b(){cout << "B!" << endl;}
void c(){cout << "C!" << endl;}
};
int main()
{
void (Obj::*pFn)();
Obj obj;
pFn=&Obj::a;
obj->*pFn();
pFn=&Obj::b;
obj->*pFn();
pFn=&Obj::c;
obj->*pFn();
system("PAUSE");
return 0;
}
Help? Thanks!!!!!
class Obj
{
public:
void a(){cout << "A!" << endl;}
void b(){cout << "B!" << endl;}
void c(){cout << "C!" << endl;}
};
int main()
{
void (Obj::*pFn)();
Obj obj;
pFn=&Obj::a;
obj->*pFn();
pFn=&Obj::b;
obj->*pFn();
pFn=&Obj::c;
obj->*pFn();
system("PAUSE");
return 0;
}
Help? Thanks!!!!!