1.

Consider the following code:class ci{int l;public: ci(int j) { l=j; }ci(ci &rv) { l=rv.l; }void initialize() { l=0; }};main() {ci original(1);ci X1(original);ci X2=original;}Referring to the sample code above, what initializes the object X1?i. Initialize() functionii. The default constructoriii. The copy constructoriv. The default copy constructorJustify your answer.

Answer»

The default constructor initializes the object X1 as constructor is invoked as soon as the object is created.



Discussion

No Comment Found

Related InterviewSolutions