What will be the output of the following program? #include<iostream.h>
class CuriousTabBase
{
public:
CuriousTabBase()
{
cout<< "Base OK. ";
}
virtual ~CuriousTabBase()
{
cout<< "Base DEL. ";
}
};
class CuriousTabDerived: public CuriousTabBase
{
public:
CuriousTabDerived()
{
cout<< "Derived OK. ";
}
~CuriousTabDerived()
{
cout<< "Derived DEL. ";
}
};
int main()
{
CuriousTabBase *basePtr = new CuriousTabDerived();
delete basePtr;
return 0;
}
Correct Answer: Base OK. Derived OK. Derived DEL. Base DEL.
Discussion & Comments