Show the output of the following code:
#include
using namespace std;
class Parent
{
public:
Parent()
{
cout << "Parent's no-arg constructor is invoked" << endl;
}
~Parent()
{
cout << "Parent's destructor is invoked" << endl;
}
};
class Child: public Parent
{
public:
Child()
{
cout << "Child's no-arg constructor is invoked" << endl;
}
~Child()
{
cout << "Child's destructor is invoked" << endl;
}
};
int main()
{
Child c1;
Child c2;
return 0;
}
We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.