Friday 5 April 2013

Can a copy constructor accept an object of the same class as parameter, instead of reference of the object?



Can a copy constructor accept an object of the same class as parameter, instead of reference of the object?
No. It is specified in the definition of the copy constructor itself. It should generate an error if a programmer specifies a copy constructor with a first argument that is an object and not a reference.


Blog Author: Vijay Kumar

No comments:

Post a Comment