Mastering C++: A Comprehensive Quiz Based on 'Thinking in C++'

Disable ads (and more) with a membership for a one time $2.99 payment

Test your C++ skills with our quiz based on Bruce Eckel's 'Thinking in C++'. Dive into object-oriented programming, advanced topics, and fundamentals. Perfect for learners and experts alike. Assess your knowledge and become a C++ master!

Each practice test/flash card set has 50 randomly selected questions from a bank of over 500. You'll get a new set of questions each time!

Practice this question and more.


What is the purpose of the PStash class?

  1. To manage storage of primitive types

  2. To handle only static objects

  3. To hold pointers instead of objects

  4. To extend the functionality of Stack

The correct answer is: To hold pointers instead of objects

The purpose of the PStash class is to hold pointers instead of objects in order to allow for more flexible storage of different data types. Option A is incorrect as the PStash class can handle any type of data, not just primitive types. Option B is incorrect as the class allows for both static and dynamic objects to be stored. Option D is incorrect as the PStash class does not extend the functionality of Stack, but rather provides its own unique functionality.