Operator overloading doubt

cin>>d1 is euivalent to operator>>(cin, d1)
cin get in as a first parameter and d1 get in second parameter

but when we do c1+c2 which is equivalent to c1.+(c2)
and here c2 is passed as parameter but not c1

so hy do c1 does get as a parameter and cin gets ???

That’s because it is a unary operator, you can overload unary operator outside class also, but if for e.g you have to overload + operator, then you need to have a class.

when we do c1+c2 which is equivalent to c1.+(c2)
and here c2 is passed as parameter but not c1

i tried to do in class but it causes a compilation error. ony c2 is recieved as parameter and but not c1