What is copy constructor?
Page 1 of 1
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);
Similar topics
» What is copy constructor?
» Explain Copy Constructor.
» Difference between a copy constructor and an assignment operator.
» Difference between a copy constructor and an assignment operator.
» What are shallow and deep copy?
» Explain Copy Constructor.
» Difference between a copy constructor and an assignment operator.
» Difference between a copy constructor and an assignment operator.
» What are shallow and deep copy?
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum