Ace Your C++ Skills 2026 – Rock the ‘Thinking in C++’ Challenge!

1 / 565

Why might the Smalltalk solution for containers be problematic in C++?

C++ does not have inheritance

C++ allows multiple inheritance, allowing for separate class hierarchies

In C++, multiple inheritance allows for a class to inherit from two or more base classes, whereas in Smalltalk, classes can only have one superclass. As a result, in C++, container classes may have separate class hierarchies, making it difficult to determine how data should be stored and accessed within the containers. This is why the Smalltalk solution may be problematic in C++. The other options are incorrect as they do not address the difference in inheritance and multiple class hierarchies between Smalltalk and C++.

Get further explanation with Examzify DeepDiveBeta

C++ containers cannot hold pointers to objects

C++ does not support object-oriented programming

Next Question
Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy