C++ MQCs with Explanation (CHAPTER 7: OPERATOR OVERLOADING)

State which of the following statements is TRUE

  1. Operator functions never return a value
  2. Friend functions cannot be used for operator overloading
  3. An operator function must have at least one argument
  4. The overloaded operator must have at least one operand that is of user-defined type.



Answer: 
Option b and d: (b:Friend functions cannot be used for operator overloading)(d:The overloaded operator must have at least one operand that is of user-defined type

Explanation Here

Post a Comment

0 Comments