Hello,
I wanted to know if calling a virtual function from another
virtual function is valid or not.I was working on an assignmnet where
the functions are pure in the base class and have definitions in the
derived class.
I used g++ to compile the code and I was getting a runtime error
saying "pure virtual function called. aborted".
The program executes fine when the declaration is removed in the
base class.Can anyone please tell me the reason?
I have included the brief structure of the code
class base
{
public:
virtual void abc();
virtual void efg();
};
class derived: public base
{
public:
virtual void abc(){ }
virtual void efg(){ ...
abc();
...
}
};
Regards,
Sowmya