You can pass a pointer to a member, but in order to call the member
function through it, you will also need to pass a reference to an
object:

class A
{
public:
void f();
};

int func(A& r, void (A::*pmf)())
{
(r.*pmf)(); // call member function through ptr
}

int main()
{
A a;
void (A::*p)() = &A::f; //take member's address

func(&a, p);
}


Danny Kalev

"The ANSI/ISO C++ Professional Programmer's Handbook"
http://www.amazon.com/exec/obidos/ASIN/0789720221


"Helder Simões" wrote:
>
> Hi,
>
> I have a problem: is it possible to pass a class member function as an argument
> to another function?
>
> I know it is possible with normal functions, but I couldn't figure it out
> with class members.
>
> Thanks.