I'm confused by this... In the book I'm reading, it shows that
this takes a parameter of a reference... But why? I don't understand
how this works.
Will someone explain to me how this works? Does vartwoCode:cOBJECT cOBJECT :: operator + (const cOBJECT &r){ return cOBJECT(value + r.GetValue()); } cOBJECT varone(3); cOBJECT vartwo(2); cOBJECT varthree; varthree = varone + vartwo;
automatically get passed through this parameter when it's
added to varone?
Another question, exactly which variable is '+' being applied to?
Which variable's overloaded-operator-function is being called?
I'm very confused...
![]()



LinkBack URL
About LinkBacks




