#include using namespace std; class TestT{ public: // default constructor TestT(void){ cout << "In the default constructor" << endl; return; } // copy constructor //TestT(TestT rhs) { TestT(const TestT & rhs) { cout << "In the copy constructor" << endl; name = rhs.name+"-copyConstructor"; return; } // destructor ~TestT() { cout << "In the destructor" << endl; cout << "Name = " << name << endl; return; } // overloaded assignment operator // a = b = c = d = e = 7; TestT & operator = (const TestT & rhs) { cout << "In the assignment operator" << endl; name = name + rhs.name; return * this; } void SetName(string n) { name = n; return; } string GetName(void) const{ return name; } private: string name; }; void ValueParam(TestT param); void ReferenceParam(TestT & param); int main() { cout << " Declaring a and b " << endl; TestT a, b; a.SetName("a"); b.SetName("b"); cout << "\ta.name = " << a.GetName() << endl; cout << "\tb.name = " << b.GetName() << endl; cout << endl; cout <<"Executing TestT c(a)" << endl; // TestT c; TestT c(a); cout << "\tc.name = " << c.GetName() << endl; cout << endl; cout << "Calling ValueParam(a)" << endl; ValueParam(a); cout << "\ta.name = " << a.GetName() << endl; cout << endl; cout << "Calling ReferenceParam(a)" << endl; ReferenceParam(a); cout << "\ta.name = " << a.GetName() << endl; cout << endl; cout << "Executing a=b" << endl; a = b; cout << "\ta.name = " << a.GetName() << endl; cout << endl; a.SetName("a"); b.SetName("b"); c.SetName("c"); cout << "Executing c = a = b " << endl; c = a = b; cout << "\ta.name = " << a.GetName() << endl; cout << "\tb.name = " << b.GetName() << endl; cout << "\tc.name = " << c.GetName() << endl; cout << endl; return 0; } void ValueParam(TestT param){ cout << "\tIn ValueParam" <