Creating Interfaces

Some classes have a lot of implementation. They essentially stand alone like little programs—self-contained and rich in capabilities. anAccumulator is such a class.

Other classes provide a basic implementation for their descendants to extend in a general way. aTape is such a class.

Still others are designed to leverage virtual functions so that a specific feature can be extended or changed. anExternalInterface is such a class. It calls on certain of its own member functions that are intended to be overridden or extended by a descendant class.

Finally, some classes declare functions, but do not implement them, leaving implementation to their descendants. Such classes, often called interfaces or abstract classes, are intended ...

Get SAMS Teach Yourself C++ in 10 Minutes SECOND 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.