1.

Which object’s members can be called directly while overloading operator function is used (In function definition)?(a) Left operand members(b) Right operand members(c) All operand members(d) None of the membersI had been asked this question in an international level competition.Question is taken from Member Operator Function in chapter Member Functions & its Types of Object Oriented Programming

Answer»

Right answer is (a) LEFT operand members

To EXPLAIN I would say: This is because the left operand is passed implicitly. It is pointed by *this. This in turn means we can use the direct member NAMES of the OBJECT because those are again converted to a syntax CONTAINING *this pointer implicitly.



Discussion

No Comment Found

Related InterviewSolutions