Chapter 1

Planning and Building Objects

In This Chapter

arrow Recognizing objects so that you can create classes

arrow Encapsulating classes into self-contained capsules

arrow Building hierarchies of classes through inheritance

arrow Discovering classes

Step outside for a moment and look down. What is the thing you are standing on? (Hint: It’s giant, it’s made of rock and sand and stone and molten lava, and it’s covered with oceans and land.) The answer? A thing! (Even a planet is a thing.) And now go back inside. What’s the thing that you opened — the thing with a doorknob? It’s a thing, too! It’s a slightly different kind of thing, but a thing nevertheless. And what are you inside? Okay, you get the idea. Everything you can imagine is a thing — or, to use another term, an object. Remember that word: object.

Over the years, researchers in the world of computer programming (now, doesn’t that sound like an exciting job?) have figured out that the best way to program computers is to divide whatever it is you’re trying to model into a bunch of objects. These objects have capabilities and characteristics. ...

Get C++ All-in-One For Dummies, 3rd 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.