Advertisement Remove all ads

Explain Difference Between Operator Function as Member Function and as a Friend Function - Computer Science 1

Advertisement Remove all ads
Advertisement Remove all ads
Advertisement Remove all ads
Short Note

Explain difference between Operator Function as Member Function and as a Friend Function

Advertisement Remove all ads

Solution

The basic difference between operator function as a friend function and as member function is that a friend function will have only one argument for unary operators and only one for binary operators. This is because the object used to invoke the member function is passed implicitly and therefore is available for the member function. This is not the case with friend function. Arguments may be passed either by value or by reference.

Concept: C++ Programming
  Is there an error in this question or solution?
Advertisement Remove all ads
Share
Notifications

View all notifications


      Forgot password?
View in app×