हिंदी

What is Operator Function? Describe the Syntax of an Operator Function. - Computer Science 1

Advertisements
Advertisements

प्रश्न

What is Operator Function? Describe the syntax of an operator Function.

टिप्पणी लिखिए

उत्तर

(1) To define an additional task to an operator, it specify what it means in relation to the class to which the operator is applied. This is done with the help of a special function, called operator function, which describes the task.
(2) In short, a function which defines additional task to an operator or which gives a special meaning to an operator is called the operator function.
(3) The general form of operator function is,

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.
(4) Operator functions must be either member functions (non-static) or friend functions.

shaalaa.com
C++ Programming
  क्या इस प्रश्न या उत्तर में कोई त्रुटि है?
2015-2016 (March)
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×