1.

Where in the parameter list is the implicit *this is added?(a) Right most parameter(b) Anywhere in parameter list(c) Left most parameter(d) Not added to parameter listI had been asked this question during an internship interview.I would like to ask this question from Member Operator Function topic in chapter Member Functions & its Types of Object Oriented Programming

Answer»

Correct choice is (c) Left most parameter

To explain I would say: The left operand is PASSED implicitly by the compiler to the member function. But this is DONE, when the compiler adds the CALLING OBJECT as *this to the parameter list. It is ALWAYS added as the left most parameter, i.e. the first parameter of the function.



Discussion

No Comment Found

Related InterviewSolutions