Encyclopedia > Deep copy

  Article Content

Deep copy

In computing, a deep copy is copy that contains the complete encapsulated data of the original object, allowing it to be used independently of the original object. In contrast, a shallow copy is a copy that may be associated to data shared by the original and the copy.

For example, if a C++ class contains a pointer to a null-terminated string, the deep copy would also copy the string, while the shallow copy would create an object where the pointer points to same string, and changes to it affect both objects.



All Wikipedia text is available under the terms of the GNU Free Documentation License

 
  Search Encyclopedia

Search over one million articles, find something about almost anything!
 
 
  
  Featured Article
East Islip, New York

... population is spread out with 28.5% under the age of 18, 6.3% from 18 to 24, 32.3% from 25 to 44, 21.1% from 45 to 64, and 11.8% who are 65 years of age or older. Th ...

 
 
 
This page was created in 33.6 ms