Self-Review Exercises

  1. 12.1 Fill in the blanks in each of the following statements:

    1. Treating a base-class object as a(n)                 can cause errors.

    2. Polymorphism helps eliminate                 logic.

    3. If a class contains at least one pure virtual function, it’s a(n)                 class.

    4. Classes from which objects can be instantiated are called                 classes.

    5. Operator                 can be used to downcast base-class pointers safely.

    6. Operator typeid returns a reference to a(n)                 object.

    7.                 involves using a base-class pointer or reference to invoke virtual functions on base-class and derived-class objects.

    8. Overridable functions are declared using keyword                .

    9. Casting a base-class pointer ...

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.