// Demo of deep copy, which defines both the copy and the assignment constructor shallow copy #include #include using namespace std; class myVec { public: myVec(int n){size=n; data=new int[size];}; myVec(){size=10; data=new int[size];}; ~myVec(){delete [] data;}; myVec(const myVec& a); // copy constructor from a myVec& operator=(const myVec& a); // assignment operator from a void print(); // Print data int *data; int size; }; void myVec::print(){ cout << "["; for (int i=0; i