What is the difference between shallow copy and deep copy?

Answer Posted / hrpynux@gmail.com

A shallow copy constructs a new compound object and then (to the extent possible) inserts references into it to the objects found in the original. A deep copy constructs a new compound object and then, recursively, inserts copies into it of the objects found in the original.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can we use this pointer inside static member function?

630


What is the difference between structures and unions?

585


What is name hiding in c++?

617


What is function overloading c++?

572


Define pure virtual function?

564






What is format for defining a structure?

590


what is C++ exceptional handling?

630


What are static type checking?

632


What is a character in c++?

567


What is using namespace std in c++?

610


Give example of a pure virtual function in c++?

587


What is constructor in C++?

632


what is Loop function? What are different types of Loops?

645


How do you flush std cout?

573


What is the v-ptr?

643