Skip to Main Content
Sams Teach Yourself C++ in 24 Hours, fifth edition
book

Sams Teach Yourself C++ in 24 Hours, fifth edition

by Jesse Liberty, Rogers Cadenhead
April 2011
Beginner content levelBeginner
464 pages
9h 18m
English
Sams
Content preview from Sams Teach Yourself C++ in 24 Hours, fifth edition

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

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.
Start your free trial

You might also like

Sams Teach Yourself C++ in 24 Hours, Sixth Edition

Sams Teach Yourself C++ in 24 Hours, Sixth Edition

Rogers Cadenhead, Jesse Liberty

Publisher Resources

ISBN: 9780672331855Purchase book