what is operator overloading?? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

what is operator overloading??

unary binary and static operators...

14th Nov 2016, 6:31 AM
AkTHEDEVIL
1 Answer
+ 3
Operator overloading is just a way to make a function work with multiple types. Id est: int rect(int length, int width) { return length * width } // But you can only give it integers... double rect(double length, double width) { return length * width } // Violã! Now the same function can // use integers or doubles.
15th Nov 2016, 3:10 AM
Keto Z
Keto Z - avatar