Hour 8. Creating Basic Classes

What Is a Type?

One of the things that distinguishes humans is our ability to categorize. We don’t see hundreds of shapes in nature; we see animals, rocks, insects, and trees. We don’t just see animals; we see bears, foxes, raccoons, sasquatches, and so forth. We divide things into various classes that tell us what type of thing they are.

A sasquatch is a type of mammal. A mammal is a type of animal. An animal is a type of living thing.

In C++, a type is an object with data and a set of abilities. You’ve worked with built-in types such as int, long, and float numbers. You ...

Get Sams Teach Yourself C++ in 24 Hours, fifth 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.