Hi All,
Can anybody help me to assign a base class function pointer in derived class constructor? I have got a compilation error while doing so. Please see the code below:
class Base
{
public:
void (* fnptr) (void) ;
void myvurtualfn()
{
}
};
class Derived:public Base
{
public:
void myvurtualfn1()
{
}
Derived()
{
fnptr =this->myvurtualfn1(); //error C2440: '=' : cannot convert from 'void' to 'void (__cdecl *)(void)'
}
};
Thanks in Adv,
Je