"John Cho" <jo*****@johncho.us> wrote in message
news:Xn*******************************@199.45.49.1 1...
if i do a friend Testclass operator +(Test class &obj2); it is
not correct because i need two objects?
It depends what you want to do. If you declare operator+ as above, you
get a unary operator+ which might be used like this, for example (for
illustration, I'm assuming you also have a binary operator*):
Test a, b, c;
c = +b * a
If you want to be able to write
c = a + b
you need to define a binary operator+, which you might declare as
follows:
Test operator+(const Test&, const Test&);
Jonathan