Advertisement Remove all ads

Describe the syntax of an Operator Function. - Computer Science 1

Describe the syntax of an Operator Function.

Advertisement Remove all ads

Solution

return-type class-name : : operator op(argument list)
{
function body//task defined
}

Where return type is the of value returned by the specified operation and op is the operator being overloaded.
The op is preceded by the keyword operator. Operator op is the function name.

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

APPEARS IN

Advertisement Remove all ads
Advertisement Remove all ads
Share
Notifications

View all notifications


      Forgot password?
View in app×