In C++ is it possible to call base class function from derived class object?

  • Thread starter Thread starter sgrm123
  • Start date Start date
S

sgrm123

Guest
Hi,

class Base

{

virtual func(char* buf, int l);

};

class Derived: public Base

{

virtual func(char* buf, int l);

};

class Ext: public Derived

{

bool b;

void Call();

};

void Ext::Call()

{

if(b)

{

//call base class func

}

else

{

} //call derived class func

}


In the derived class of derived class based on some condition I have to call base class function or derived class function. Is it possible in C++?

Thanks

Continue reading...
 
Back
Top