By eHow Computers Editor
Rate: (2 Ratings)
A copy constructor is a special member function inside a class. It accepts a reference to an existing object of the same class type and makes a deep copy of that object. A deep copy not only copies all member fields but also copies any dynamically allocated memory. C++ compilers do copy construction automatically. You need to define a copy constructor when your class involves dynamic memory.