operator-overloading

Operator overloading is a beautiful concept in C++. At times it is little confusing also. But actually they are quite easy. Anyway, here is an example for overloading the stream operators. The best way to overload the stream operators is not to make them members of any class, but to keep them as friends. i.e., [...]

   C++ overloading clearly advocates simplicity in usage and readability. That is why all forms of operators are getting overloaded to give natural and domain oriented meanings. The increment operator ++ can be called in two forms post fix and pre fix. The programmers will have a slight difficulty in overloading/using it because, they won’t [...]

   C++ overloading is the mechanism by which the language standard operators are used for customized operations of the classes. For example if we are trying to write a string class, we would very simply ask for “+” operator to handle string concatenation, “-” for removing one part of string from another etc., This will [...]