One of the very important part writing class in C++ is to implement copy constructor and overloaded = operator function. This tutorial talks about the need of writing these functions in order to make your program more effective. Before getting into the concept lets understand basic terminology. Constructor : Its a special function called when object of class is created. Ideally a constructor must contain the logic to initialize the data members of the class. Copy Constructor: It is called when and object is initialized at the time of creation. There exist more scenario when an copy constructor is called.
The post How to perform Shallow Copy and Deep Copy in C++ appeared first on Coding Security.
How to perform Shallow Copy and Deep Copy in C++
read more
Tidak ada komentar:
Posting Komentar