1.

The copy constructor can be used to ____________(a) Initialize one object from another object of same type(b) Initialize one object from another object of different type(c) Initialize more than one object from another object of same type at a time(d) Initialize all the objects of a class to another object of another classThe question was posed to me in semester exam.This intriguing question originated from Copy Constructor in division Constructors and Destructors of Object Oriented Programming

Answer»

Right CHOICE is (a) Initialize one object from another object of same type

Explanation: The copy constructor has the most BASIC function to initialize the members of an object with same VALUES as that of some previously CREATED object. The object must be of same CLASS.



Discussion

No Comment Found

Related InterviewSolutions