I'm facing a difficulty with this little question in my quiz question.
Here's the question:
- Write Two (2) C++ statement to allocate and delete an object of class Parent dynamically.
#include <iostream>
usingnamespace std;
class Parents{
public:
Parents(){cout<<"I'm a Father\n";}
virtual ~Parents(){cout<<"I'm a Mother\n";}
};
class Son : public Parents{
public:
Son(){cout<<"I'm a Son\n";}
virtual ~Son(){cout<<"I'm a Daughter\n";}
};
int main()
{
//missing code here
return 0;
}