Operator overloading helps us give the standard C++ operators,for instance through the use of operator overloading we can use the '+' operator to concatenate two strings (Bill + Gates = Bill Gates).You can use operator overloading to overload operators to add objects,this is not normally possible through the use of standard operators.
Click >>>HERE<<< for a good tutorial on operator overloading.
The use of operator overloading is illustrated here through the use of easy to understand programs.
- A program to overload the '==' operator,
- A program to find the areas of geometric figures by using function overloading,
- A program to overload the '-' minus operator,
- A program to overload the '+=' operator,
- A program to overload the '++' operator.
|