Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ArtCollection::ArtCollection(const ArtCollection& source)
- {
- cout << "Copy Constructor Called" << endl;
- size = source.size;
- used = source.used;
- Array = new string[source.size];
- // Use of the standard library copy function
- // copy(first, last, destination)
- // The first parameter holds the start address and the
- // second parameter holds the address where
- // the copy will end. The copy will copy all values
- // from first up to but not inclusive of the value at last
- // from the source to the destination. Here we only want
- // to copy the rocks from the "used" portion of the container.
- copy(source.Painting, source.rockHolder + used, rockHolder);
- // An alternative to the copy above would be to use a for loop.
- // for(int i = 0; i < used; i++)
- // {
- // rockHolder[i] = source.rockHolder[i];
- // }
- }
Add Comment
Please, Sign In to add comment