In the context of operator overloading, the expression a + b is equivalent to _______. 

  • a.add(b) 
  • a.operator+(b) 
  • a.plus(b) 
  • a.combine(b)
Operator overloading allows operators to be redefined and used where one or both of the operands are of a user-defined class. In the context of C++, the expression a + b where the + operator is overloaded can be reinterpreted as a.operator+(b). This allows developers to specify the behavior of the + operator for user-defined types.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *