Chapter 12

A1: The public members of the base class become public members of the derived class. The protected members of the base class become protected members of the derived class. The private members of the base class are inherited, but cannot be accessed directly. The answer to review question 2 provides the exceptions to these general rules.
A2: The constructors methods are not inherited, the destructor is not inherited, the assignment operator is not inherited, and friends are not inherited.
A3: First, the return value is only if you use the value of an assignment expression, as when you chain assignment. That is, in a statement like
A = B = C;

the return value of

B.operator=(C);

gets assigned to A. For this purpose, returning an object ...

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.