21.8 — Overloading the increment and decrement operators

Overloading the increment (++) and decrement (–) operators is pretty straightforward, with one small exception. There are actually two versions of the increment and decrement operators: a prefix increment and decrement (e.g. ++x; –y;) and a postfix increment and decrement (e.g. x++; y–;). Because the increment and decrement operators are …

21.5 — Overloading operators using member functions

In lesson , you learned how to overload the arithmetic operators using friend functions. You also learned you can overload operators as normal functions. Many operators can be overloaded in a different way: as a member function. Overloading operators using a member function is very similar to overloading operators using …