-
Overloading Operators
I'm working on a project and I need to overload some of the
basic operators (*, /, +, -, etc...) to work with Measure, my user-
defined class. I've managed to overload * so that Measure *
double works (that is the double value is on the right hand of
the binary operator), but I can't figure out how to reverse that so
that I can get double * Measure to work.
Does anyone have any idea how to fix this?
On a side note, why does the server think I logged in as Strahan. I'm not Strahan, and I didn't even log in.
-
friend measure operator * (double& d,measure& m)
{
// do stuff
}
ps I have assumed you are returning a measure.You may not be you didn't give much information.
-
The thing about being logged in as Starahan automaticly: you must have selected "cookies" to be enabled on this site. Cookies are little files that contain your username + password ect. This enables the site to automaticly log you in without having to go to the log-in screen
-
Oops. I meant to say that SOMEONE ELSE must have created the name Starahan on your computer and enabled cookies on this site.
-
Thanks. That did the trick.
:)