+ 2
Operator overloading
What is the main purpose of operator overloading in c++ or any other programming language? Any examples that can only be done using overloaded operator
6 odpowiedzi
+ 7
Operator overloading is not needed, but make things clearer. Instead of many function calls with your class variables: d.plus(e).times(f), you can code: (d+e)*f. Here is a simple example of using it. It includes links to similar code in other languages.
https://code.sololearn.com/cStdw0OPtPxG
+ 3
One example of operator overloading is for doing some maths operations like +,×,÷,/etc b/w user defined datatypes like class struct.
+ 3
Thank you everybody you help me so much,
now i understand it,
keep up a good work!! Thanks
+ 1
In "More On Classes" chapter
https://www.sololearn.com/learn/CPlusPlus/1901/
+ 1
Hello
+ 1
How we can know the problem solve in function