What Is a Type?
A type is a category. One of the things that distinguishes humans is our ability to categorize. We don't see hundreds of shapes on the savanna; we see animals and trees. And we don't just see animals; we see gazelles, giraffes, elephants, water buffalo, and so forth. Humans created taxonomies, classifications, orders, groupings, divisions, and classes. In short, we think in terms of types of things.
An orange is a type of citrus. A citrus is a type of fruit. A fruit is a type of plant. A plant is a type of living thing.
Familiar types include car, house, person, and shape. In C++, a type is an object with a size, a state, and a set of abilities.
A C++ programmer can create any type needed, and each of these new types can have ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access