#include #include using namespace std; class Person { char* name; public: Person() : name(nullptr) {} Person(const char *); ~Person(); void print() const; void changeName(const char* newName); }; Person::Person(const char* n) : name(new char[strlen(n)+1]) { strcpy(name,n); } Person::~Person() { delete [] name; name = nullptr; } void Person::print() const { cout << name << endl; } void Person::changeName(const char* newName) { strcpy(name,newName); } int main() { Person john("John Smith"); Person clone(john); john.print(); clone.print(); clone.changeName("John Clone"); john.print(); clone.print(); cout << "End of program" << endl; }