Chapter 9. Objects and Classes

You will learn about the following in this chapter:

  • Procedural and object-oriented programming

  • The class concept

  • How to define and implement a class

  • Public and private class access

  • Class data members

  • Class methods (class function members)

  • Creating and using class objects

  • Class constructors and destructors

  • const member functions

  • The this pointer

  • Creating arrays of objects

  • Class scope

  • Abstract data types (ADTs)

Object-oriented programming (OOP) is a particular conceptual approach to designing programs, and C++ has enhanced C with features that ease the way to applying that approach. The most important OOP features are these:

  • Abstraction

  • Encapsulation and data hiding

  • Polymorphism

  • Inheritance

  • Reusable code

The class is the single ...

Get The Waite Group's C++ Primer Plus, Third 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.