Consider the following code:
#include<iostream>
using namespace std;
class A
{
public:
A()
{
cout << "Constructor of A\n";
};
~A()
{
cout << "Destructor of A\n";
};
};
class B
{
public:
B()
{
cout << "Constructor of B\n";
};
~B()
{
cout << "Destructor of B\n";
};
};
class C
{
public:
A objA;
B objB;
};
int main()
{
C *pC;
pC = new C();
delete pC;
return 0;
}
What will be the printed output?
Correct Answer: Constructor of A Constructor of B Destructor of B Destructor of A
Explanation:
Note: This Question is unanswered, help us to find answer for this one
More C++ MCQ Questions