Review Questions

1: Use a member function to overload the multiplication operator for the Stonewt class; have the operator multiply the data members by a type double value. Note that this will require carryover for the stone-pound representation. That is, twice 10 stone 8 pounds is 21 stone 2 pounds.
2: What are the differences between a friend function and a member function?
3: Does a nonmember function have to be a friend to access a class's members?
4: Use a friend function to overload the multiplication operator for the Stonewt class; have the operator multiply the double value by the Stone value.
5: Which operators cannot be overloaded?
6: What restriction applies to overloading the following operators? = () z[] ->
7: Define a conversion ...

Get The Waite Group's C++ Primer Plus, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.