1.

How the argument passed to a function get initialized?(a) Assigned using copy constructor at time of passing(b) Copied directly(c) Uses addresses always(d) Doesn’t get initializedThe question was asked during an online exam.This question is from Assigning Objects topic in division Assigning Object, Pointer to Objects, Passing and Returning Object of Object Oriented Programming

Answer»

Right ANSWER is (a) ASSIGNED using copy constructor at time of passing

The explanation: The arguments get INITIALIZED using the copy constructor. There is a need of assigning the VALUE of all the members of an OBJECT to the local object of the function.



Discussion

No Comment Found

Related InterviewSolutions