#include #include #include using namespace std; class A { public: A(); A(A& NewA); ~A(); int x; }; A::A() { cout << "A's Constructor" << endl; } A::A(A& NewA) { cout << "A's Copy Constructor" << endl; } A::~A() { cout << "A's Destructor" << endl; } void main() { try { A a1; A a2; a2.x = 3; throw a2; //when an object is thrown its copy constructor is automaticaly called } catch(A& a) //try this with and without a pass by reference { cout << a.x << endl; } }