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

What are c++ storage classes?

622


Write about all the implicit member functions of a class?

602


write a program that withdrawals,deposits,balance check,shows mini statement. (using functions,pointers and arrays)

1807


How do you initialize a string in c++?

566


What are signs of manipulation?

598






What does floor mean in c++?

582


Do you know what are the new features that iso/ansi c++ has added to original c++ specifications?

562


Does improper inheritance have a potential to wreck a project?

635


What is the use of pointer in c++ with example?

563


How can an improvement in the quality of software be done by try/catch/throw?

594


How const int *ourpointer differs from int const *ourpointer?

612


What is c++ and its features?

578


Explain about Garbage Collector?

651


What does new do in c++?

639


How the keyword struct is different from the keyword class in c++?

587