Hi there,
I've been experimenting with operator overloading, and I can't seem to overload the * operator where the right hand side operand is a plain integer (i.e. only the lhs is a member of the class). Should that be the case, or am I doing something wrong?
Basically, my class has three integer members, and I want to overload * to be able to multiply all members by the same integer.
Thanks!
I've been trying to do it as a member function, and I just can't work out what I'm doing wrong.
I have overloaded the + operator in the same class, and it works perfectly.
The only difference I can see is that with my + overload both operands are members of my class, but with my * overload, only the lhs is. Could that be a reason for my problem?