1.

Which operator among the following can be overloaded using both friend function and member function?(a) Assignment operator(b) Subscript(c) Member selection (arrow operator)(d) Modulus operatorI have been asked this question in unit test.Origin of the question is Member Operator Function topic in chapter Member Functions & its Types of Object Oriented Programming

Answer»

Correct option is (d) Modulus OPERATOR

For explanation: Only the modulus operator among the given OPERATORS can be overloaded using either friend FUNCTION or member function. Other operators must be overloaded using only the member FUNCTIONS.



Discussion

No Comment Found

Related InterviewSolutions