Q:

Distinguish between shallow copy and deep copy in c++?

0

Distinguish between shallow copy and deep copy

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

Answer:

Comparison chart explains the difference between the Shallow Copy and Deep Copy:

Shallow Copy Deep Copy
Shallow Copy stores the references of objects to the original memory address. Deep copy stores copies of the object’s value.
Shallow Copy reflects changes made to the new/copied object in the original object. Deep copy doesn’t reflect changes made to the new/copied object in the original object.
Shallow copy is faster. Deep copy is comparatively slower.

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

C++ Interview Questions For Experienced

This question belongs to these collections

Similar questions


need a help?


find thousands of online teachers now
Friend class and function in C++?... >>
<< How do you access the static member of a class in ...