I have "right" overloading working fine with:

Vector Point::operator*( double P )

this would be called with MyPoint*2 and gives the results I would like. However, if I say:

2*MyPoint, it says I can't do that. Makes sense, but surely this can be done! I had trouble googling because I didn't know what to call this!

Any help will be appreciated!

Dave

Recommended Answers

All 3 Replies

Link. Check out my post at the bottom.

(Sorry, I've got lazy fingers today.)

commented: Great solution -- I hadn't thought of that. :) +24

beautiful! thanks!

beautiful! thanks!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.