1.

Out of memory error is given when the object _____________ to the copy constructor.(a) Is passed with & symbol(b) Is passed by reference(c) Is passed as (d) Is not passed by referenceThe question was asked by my college professor while I was bunking the class.The query is from Copy Constructor in division Constructors and Destructors of Object Oriented Programming

Answer»

Right answer is (d) Is not passed by reference

Easiest explanation - All the OPTIONS given, directly or INDIRECTLY indicate that the object is being passed by reference. And if object is not passed by reference then the out of memory ERROR is produced. DUE to infinite CONSTRUCTOR call of itself.



Discussion

No Comment Found

Related InterviewSolutions