Computer Science, asked by vedsanisahu7682, 1 year ago

Difference between unary operator overloading and binary operator overloading

Answers

Answered by WhatsInTheName
5
In unary operator overloading only the argument type can be changed but in binary operator overloading the argument type and order can be changed .
Answered by franktheruler
13

Answer:

Unrary operator overloading :

1 ) operating overloading function works on the single value .

2 ) number of the object passed to the function is one only.

3 ) It is simple to use.

4 ) example : - ( minus operator )

Binary operator overloading :

1 ) Overloading binary operator works on two values.

2 ) number of objects passed to the operator function are two.

3 ) It is little difficult.

4 ) example : < ( less than operator )  

Similar questions