inside the operator overloading why aren’t we taking two students as arguments and then comparing their roll
numbers instead of writing
rollno == s.rollno
inside the operator overloading why aren’t we taking two students as arguments and then comparing their roll
numbers instead of writing
rollno == s.rollno
Hey @anindya-gupta
This is because u are declaring it inside class as its member so it already have a Student object from which u will call it.
You can’t do this like that because
== operator is called when (a ==b) something like this is written so here a calls the == operator and b is passed in it.