Operator overloading is an important feature of C++ and it allows to attach an additional meaning to operators when used with user defined data types i.e. classes. When an operator is overloaded, it gains an additional meaning relative to the class in which it is used.
or
Operator overloading refers to the technique of giving normal c++ operators an additional meaning when they are applied to user defined data types/classes.
Using operator overloading complex program segments can be replaced by more natural looking statements.
Example:
(1) To concatenate two string we write the statement as
string s1,s2,s3;
s3=s2.concatenate(s1);
s3=s2.hello(s1);
s3=hello(s1,s2);
Using operator overloading the above statement can be written as
s3=s1+s2;
(2) To add two distance objects
distance d1,d2,d3;
d1.read();d2.read();
d3=add(d1,d2);
d3=d1.add(d2);
d3=hello(d1,d2);
d3=d1.hello(d2);
Using operator overloading the above statements can be written as
d3=d1+d2;