First page Back Continue Last page Graphics
Why you might need a friend.
A = B * 2.75;
translates to
A = B.operator*(2.75);
B can be of type Time.
But, A = 2.75 * B;
2.75 cannot be type Time!!
Most operators can be overloaded by member functions or non-member functions. Therefore compiler could match with A = operator*(2.75, B);
prototype: Time operator*(double m, const Time & t);