First page Back Continue Last page Graphics
Creating Friends
Class prototype:
- friend Time operator*(double m, const Time & t);
Two implications:
- It is declared in the class, but it is not a member function.
- It has same access rights as a member function.
Function definition:
- Time operator*(double m, const Time & t)
- { Time result;
- long totalminutes = .....
- .....
- }
Time:: qualifier isn't used.
friend keyword isn't used.