1.

If a friend overloaded operator have to be changed to member overloaded operator, which operator should be used with the class name?(a) Scope resolution operator(b) Colon(c) Arrow operator(d) Dot operatorI had been asked this question during an interview.This is a very interesting question from Member Operator Function topic in chapter Member Functions & its Types of Object Oriented Programming

Answer»

Correct choice is (a) Scope resolution OPERATOR

Best explanation: The scope resolution operator can be used followed by the class name. Then the operator keyword with the operator symbol that should be OVERLOADED. This is done to USE member function INSTEAD of FRIEND function.



Discussion

No Comment Found

Related InterviewSolutions