What is deep copy?

Options
- A deep copy creates a copy of the dynamically allocated objects too.
- A deep copy just copies the values of the data as they are.
- A deep copy creates a copy of the statically allocated objects too
- Both b and c above


CORRECT ANSWER : A deep copy creates a copy of the dynamically allocated objects too.

Discussion Board
C++ - Deep Copy

A deep copy copies all fields, and makes copies of dynamically allocated memory pointed to by the fields. To make a deep copy, you must write a copy constructor and overload the assignment operator, otherwise the copy will point to the original, with disastrous consequences.

Prajakta Pandit 01-24-2017 12:31 AM

deep copy

in shallow copy the default copy constructor provided by the compiler copy the address of memory location instead copy the content.

Prabeen pradhan 02-6-2015 10:10 AM

rt

gu

m 01-22-2015 05:03 PM

c++

good

krishna 01-18-2015 01:32 AM

Write your comments


Enter the code shown above:

(Note: If you cannot read the numbers in the above image, reload the page to generate a new one.)


Advertisement