+3 votes
in Class 12 by kratos

Explain the features of copy constructor.

1 Answer

+6 votes
by kratos
 
Best answer

The features of copy constructor are:

  1. The copy constructor should have at least one argument of the same class and this argument must be passed as a constant reference type.

  2. If additional arguments are present in the copy constructor, then it must contain default arguments.

  3. Explicit function call of copy constructor is not allowed.

  4. Copy constructor is also called automatically, when an object is passed to a function using pass by value.

  5. If a new object is declared and existing object is passed as a parameter to it in the declaration itself, then also the copy constructor is invoked.

...