Answers to Self-Review Exercises

  1. 10.1

    1. operator overloading.

    2. operator.

    3. assignment (=), address (&), comma (,).

    4. precedence, associativity, “arity.”

    5. ., ?:, .*, and ::.

    6. delete.

    7. new, pointer.

    8. s.

  2. 10.2 Operator >> is both the right-shift operator and the stream extraction operator, depending on its context. Operator << is both the left-shift operator and the stream insertion operator, depending on its context.

  3. 10.3 For operator overloading: It would be the name of a function that would provide an overloaded version of the / operator for a specific class.

  4. 10.4 True.

  5. 10.5 The precedence is identical.

Get C++ How to Program, 10/e 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.