C++

Topic: Constructors and destructors

What is copy constructor?  

Copy constructor allows creating new objects from existing objects by initialization. Example: First argument of is a reference to an object of the same type as is being constructed (const or non-const), which might be followed by parameters of any type (all having default values).  X(X& copyFromMe);

Browse random answers: