Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
C++
Default functions implemented by compiler
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="Sekhar, post: 2565807"] Both shallow copy and deep copy copies all of the member values and the difference lies in the case of fields which are dynamically allocated.A shallow copy will only copy the pointer for dynamically allocated memory. ie for dynamically allocated fields both the both points to the same location. A deep copy copies all fields, and makes copies of dynamically allocated memory pointed to by the fields. The default copy constructor and assignment operator make shallow copies whereas for making a deep copy we have to write copy constructor and overload the assignment operator. [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
C++
Default functions implemented by compiler
Top