Write three distinct situations in which copy constructor of a-00477

Online Quiz This subjective question is related to the book/course vu cs302 Digital Logic Design. It can also be found in vu cs302 Mid Term Solved Past Paper No. 2.

Question 1: Write three distinct situations in which copy constructor of a class is called.
Answer:
  1. Assignment of private data members at the time of object creation.
  2. When an object is passed by vale to a function.
  3. When allocating memory dynamically we use copy constructor to avoid dangling pointer issue.

Choose an organization

Theme Customizer

Gaussian Texture



Gradient Background