8

Technicalities: Classes, etc.

Remember, things take time.

– Piet Hein

In this chapter, we keep our focus on our main tool for programming: the C++ programming language. We present language technicalities, mostly related to user-defined types, that is, to classes and enumerations. Much of the presentation of language features takes the form of the gradual improvement of a Date type. That way, we also get a chance to demonstrate some useful class design techniques.

§8.1 User-defined types

§8.2 Classes and members

§8.3 Interface and implementation

§8.4 Evolving a class: Date

struct and functions; Member functions and constructors; Keep details private; Defining member functions; Referring to the current object; Reporting errors

§8.5 Enumerations ...

Get Programming: Principles and Practice Using C++, 3rd 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.