 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
| • |
Shallow
Copy:
|
|
|
|
– |
The
data members of one object are copied into the data
|
|
|
members
of another object without taking any dynamic
|
|
|
|
memory
pointed to by those data members into
|
|
|
|
consideration.
(“memberwise copy”)
|
|
| • |
Deep
Copy:
|
|
|
|
– |
Any
dynamic memory pointed to by the data members
|
|
|
|
is
duplicated and the contents of that memory is copied
|
|
|
|
(via
copy constructors and assignment operators --
|
|
|
|
when
overloaded)
|
|