1.

Which among the following is true?(a) More than one object can’t be passed to a function(b) Any number of objects can be passed to a function(c) Objects can’t be passed, only data member values can be passed(d) Objects should be passed only if those are public in classI have been asked this question in an international level competition.This intriguing question originated from Passing Object to Functions topic in portion Assigning Object, Pointer to Objects, Passing and Returning Object of Object Oriented Programming

Answer»

Correct choice is (b) Any number of OBJECTS can be passed to a function

Easiest explanation - There is no restriction on passing the number of objects to a function. The operating SYSTEM or the compiler or environment MAY LIMIT the number of arguments. But there is no limit on number of objects till that limit.



Discussion

No Comment Found

Related InterviewSolutions