O'Reilly logo

Sams Teach Yourself C++ in 24 Hours, fifth edition by Rogers Cadenhead, 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

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

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