What is operator overloading




What is operator overloading

Operator overloading facilitates us to use normal c++ operates like +, *, < = and + = with user-defined data types in the same way as they are used with basic data types like int and float.

e.g a = b+c;

Works only with basic data types and attempting to apply it when a, b and c are objects of user-defined class with cause error.

With operator overloading, we can make this statement legal even when a, b and c are user-defined types.