I have two classes A and B. I want to pass a function name in class A as parameter of function in Class B. I tried with below sample, Is it correct way.
class A
{
public:
B m_b;
void MyFun()
{
// do something
}
void Test()
{
m_b.Process( MyFun );
}
}
class B
{
public:
void Process( void (*f)() )
{
(*f)();
}
}
thanks in advance