[Dev-C++] pointers to member functions
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: michele <mic...@li...> - 2004-05-13 10:08:33
|
Question about pointers:
// A class named 'MyClass' inherits from its parent class a pointer of this
type:
void (ParentClass::*p)(int variable);
// inside a member function this is right:
(this->*p)(variable);
// outside (es. in main function):
ChildClass *MyClass=new ChildClass;
(MyClass->*p)(variable) // doesn't work (compiler: "p undeclared")
Is It possible to call this type of pointers outside member functions?
Bye
|