Jumat, 11 November 2016

How to perform Object Copy in C++ Programming

Frequently while programming there will be need to create a copy of an existing object. This can be done in three ways:   Shallow Copy   In this method the copy (object) only copies the addresses (for dynamic memory) of the source object’s members. This is similar with the semantics of static data members. A same copy is shared among several objects. Similarly, in shallow copy method, both the source and copied objects share the same memory location.   Deep Copy   In this method the copied object maintains a copy of the value of each source object’s data members.

The post How to perform Object Copy in C++ Programming appeared first on Coding Security.


How to perform Object Copy in C++ Programming
read more

Tidak ada komentar:

Posting Komentar