Q. What is the output of below program?
Code:
class base
{
public:
base()
{
cout<<"BCon";
}
~base()
{
cout<<"BDest ";
}
};
class derived: public base
{
public:
derived()
{ cout<<"DCon ";
}
~derived()
{ cout<<"DDest ";
}
};
int main()
{
derived object;
return 0;
}
β
Correct Answer: (C)
BCon DCon DDest BDest