{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Of it must perform all the usual tasks that a it

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: is that the copy is made to a The new memory location. new A copy constructor iis the class function used by s copy C++ in cases other than assignment. C++ Applied Programming It looks the same as the previous constructors It except that it has an argument of reference type of the class. of It must perform all the usual tasks that a It constructor does (allocate memory, initialise) but also must transfer the values of its argument to the class instance. the class aClass class aClass { ... // default constructor aClass(); // standard constructor aClass(..,..,..); (..,..,..); // copy constructor // aClass(const aClass&); &); ... }; W e'll see the use of the copy constructor later. We'll So let's look at the complete set. Applied Programming Here's TimeType's. Here's TimeType TimeType::TimeType(const TimeType& otherTime) { hours = otherTime.hours; hours otherTime.hours minutes = otherTime.minutes; minutes otherTime.minutes seconds = otherTime.seconds; seconds otherTime.seconds } Applied Programming Let'...
View Full Document

{[ snackBarMessage ]}