Fraction(const Fraction& f); Fraction& operator= ( const Fraction& f ); Fraction::Fraction(const Fraction& f) // this IS the shallow copy that the compiler would auto-build { numerator = f.numerator; denominator = f.denominator; } Fraction& Fraction::operator= ( const Fraction& f ) { numerator = f.numerator; denominator = f.denominator; return *this; // return calling object to enable cascading } Directory(const Directory& d); Directory& operator= (const Directory& d); Directory::Directory(const Directory& d) { maxSize = d.maxSize; currentSize = d.currentSize; // create a new array for the new object (attach to entryList) entryList = new Entry[maxSize]; // copy data from the original object into THIS one! for (int i = 0; i < currentSize; i++) entryList[i] = d.entryList[i]; } Directory& Directory::operator= (const Directory& d) { maxSize = d.maxSize; currentSize = d.currentSize; entryList = new Entry[maxSize]; for (int i = 0; i < currentSize; i++) entryList[i] = d.entryList[i]; return *this; // return calling object }