Answer:
Operator overloading is used to extend the functionality of an operator like +(addition),-(subtraction),/(Division),*(Multiplication).
Syntax for operator overloading inside the class :-
You have to use operator keyword.
Function
return type operator <operator sign> (arguments)
{
---code
}
suppose you want to extend the functionality of ++ operator for any integer so that it increases the value by two.
void operator ++(int &a)
{
a=a+2;
}
So whenever this operator is used with an argument it will increase the value to that argument by 2.
int a=5;
++(a);
a will become 7;