i am not able to understand that how are we overloading the == operator,how are the objects being compared specifically for this operator?
Operator overloading of == operator
Hello @apurvaraina99,
The work of == operator is check for equality of two variables of same type.
You can overload it to check the equality of two objects(which is not primitive data type) of a class.
What you will do?
Simply compare the corresponding data members of the object inside the overloaded function.
Hope, this would help.
Give a like if you are satisfied.
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.