O'Reilly logo

Sams Teach Yourself C++ in 24 Hours, Third Edition by Jesse Liberty

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required