1.

If programmer doesn’t define any copy constructor then _____________(a) Compiler provides an implicit copy constructor(b) Compiler gives an error(c) The objects can’t be assigned with another objects(d) The program gives run time error if copying is usedThis question was addressed to me in homework.This is a very interesting question from Copy Constructor in section Constructors and Destructors of Object Oriented Programming

Answer»

The CORRECT choice is (a) Compiler provides an implicit copy CONSTRUCTOR

To explain I would SAY: The compiler provides an implicit copy constructor. It is not mandatory to always create an explicit copy constructor. The values are copied USING implicit constructor only.



Discussion

No Comment Found

Related InterviewSolutions