Ok. In these lessons there is one thing I couldn't understand. What's the point about operator overloaded and why are they useful? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Ok. In these lessons there is one thing I couldn't understand. What's the point about operator overloaded and why are they useful?

operators overloaded

13th Jun 2016, 6:06 AM
Andrei Cîrpici
Andrei Cîrpici - avatar
2 Answers
+ 4
Example is:- If you want to add two vectors using "+" operator, like A+B, then you can use operator overloading to make functionality of adding two vectors using "+" operator.
13th Jun 2016, 7:37 AM
Zahid Ali
Zahid Ali - avatar
+ 2
Operator Overloading is done to use the operators directly to the objects instead of each and every variable ,data type. It is just like a function but a bit different.
13th Jun 2016, 6:32 AM
Vamshi Krishna
Vamshi Krishna - avatar