12.05.2015 Views

type - David Vernon

type - David Vernon

type - David Vernon

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Classes and Objects<br />

Copying a Class Object<br />

• If we require deep copies, then we must take<br />

care to define the constructors and<br />

assignments appropriately<br />

• Typically, we will define a copy constructor as a<br />

(function) member of a class for copying<br />

operations other than by assignment<br />

– This copy constructor will be declared in the<br />

following way:<br />

class_name(const class_name &class_object);<br />

– parameter is always a reference parameter<br />

Copyright © 2007 <strong>David</strong> <strong>Vernon</strong> (www.vernon.eu)

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!