O'Reilly logo

C++ Primer, Fourth Edition by Barbara E. Moo, Josée Lajoie, Stanley B. Lippman

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

Chapter 12. Classes

CONTENTS

Section 12.1 Class Definitions and Declarations 430

Section 12.2 The Implicit this Pointer 440

Section 12.3 Class Scope 444

Section 12.4 Constructors 451

Section 12.5 Friends 465

Section 12.6 static Class Members 467

Chapter Summary 473

Defined Terms 473

In C++ we use classes to define our own abstract data types. By defining types that mirror concepts in the problems we are trying to solve, we can make our programs easier to write, debug, and modify.

This chapter continues the coverage of classes begun in Chapters 2 and 5. We’ll cover in more detail the importance of data abstraction, which lets us hide the internal representation of an object while still allowing public operations to be performed on the object. ...

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