What is difference between Unary and binary operators and how-02317
This subjective question is related to the book/course vu mth718 Topics in Numerical Methods. It can also be found in vu mth718 Mid Term Solved Past Paper No. 4.
Question 1: What is difference between Unary and binary operators and how they can be overloaded?
Binary take two operators +,-,* are example of binary operators
Overloaded binary operator may return any type
Here is general syntax of overloading
Return-type operator symbol (parameters);
Operator is keyword
Page. No. 10/15
Answer:
Unary operator takes one argument. a++ is an example of unary operatorBinary take two operators +,-,* are example of binary operators
Overloaded binary operator may return any type
Here is general syntax of overloading
Return-type operator symbol (parameters);
Operator is keyword
Page. No. 10/15