Get premium membership and access questions with answers, video lessons as well as revision papers.

Explain the purpose of copy constructor and how it differs from a normal constructor.

      

Explain the purpose of copy constructor and how it differs from a normal constructor.

  

Answers


Davis
A copy constructor is involked when an object is used to initialize another.A normal constructor is called when an object is created.
Githiari answered the question on May 29, 2018 at 17:58


Next: Given this particular defined class; class strtype { char *p; int len; public: char *getstring() { return p;} int getlength() { return len;} add two constructor functions. Have the first one...
Previous: The copy constructor is also involked when a function generates the temporary object that is used as the function's return value. With this in...

View More Computer Science Questions and Answers | Return to Questions Index


Learn High School English on YouTube

Related Questions