Can anybody please explain me the difference between deep copy and shallow copy with respect to C++?
I Googled about it, and got gOOgled...
Please explain with code snippet.
deep copy vs shallow copy
- z3r0aCc3Ss
- Fame ! Where are the chicks?!
- Posts: 700
- Joined: 23 Jun 2009, 16:00
- 14
- Contact:
deep copy vs shallow copy
Beta tester for major RATs, all kinds of stealers and keyloggers.
Learning NMAP
Learning NMAP
Re: deep copy vs shallow copy
Shallow copy is the default method in C++, and is used to copy classes that do not contain dynamically allocated variables,
Deep copy is used when a class contains dynamically allocated variables
has a really good article on the difference, including the code snippets to explain.
Deep copy is used when a class contains dynamically allocated variables
Code: Select all
http://www.learncpp.com/cpp-tutorial/912-shallow-vs-deep-copying/
knuffeltjes voor mijn knuffel
[img]http://i911.photobucket.com/albums/ac320/stuphsack/Sig.jpg[/img]
[img]http://i911.photobucket.com/albums/ac320/stuphsack/Sig.jpg[/img]