2. User-Defined Types

Don’t Panic!

– Douglas Adams

Introduction

Structures

Classes

Unions

Enumerations

Advice

2.1. Introduction

We call the types that can be built from the fundamental types (§1.5), the const modifier (§1.7), and the declarator operators (§1.8) built-in types. C++’s set of built-in types and operations is rich, but deliberately low-level. They directly and efficiently reflect the capabilities of conventional computer hardware. However, they don’t provide the programmer with high-level facilities to conveniently write advanced applications. Instead, C++ augments the built-in types and operations with a sophisticated set of abstraction mechanisms out of which programmers can build such high-level facilities. The C++ ...

Get A Tour of C++ 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.