#include using namespace std ; class Demo { public: int x1 ; int x2 ; int* ptr ; Demo() { cout << "Inside the constructor method." << endl ; ptr = new int[10] ; } ~Demo() { cout << "Inside the destructor method." << endl ; delete[] ptr ; } }; int main() { Demo demo1 ; Demo demo2 = demo1 ; }