17.3 Overloading Simple Arithmetic
Operators
- = + - * / %
- Parameters types need not match
Time Time::operator+( int seconds ) const;
- Supply behavior that is analogous to the arithmetic operators;
intuitive
- E.g. (fraction.cpp, lines 61-67)
(See next slide)
prev
|top
|next