1.

The copy constructors can be used to ________(a) Copy an object so that it can be passed to a class(b) Copy an object so that it can be passed to a function(c) Copy an object so that it can be passed to another primitive type variable(d) Copy an object for type castingThe question was asked during a job interview.The above asked question is from Copy Constructor topic in chapter Constructors and Destructors of Object Oriented Programming

Answer»

The correct option is (B) Copy an OBJECT so that it can be passed to a function

The explanation is: When an object is passed to a function, actually its copy is made in the function. To copy the values, copy CONSTRUCTOR is USED. HENCE the object being passed and object being used in function are different.



Discussion

No Comment Found

Related InterviewSolutions