Chapter 6

Object-Oriented Programming

Lesson Objectives

By the end of this chapter, you will be able to:

  • Compose classes that inherit properties from other classes
  • Implement polymorphism in C++ programs
  • Implement interfaces
  • Use best practices to manage dynamic memory

In this chapter, you will learn how to use the advanced features of C++ to create dynamic programs.

Introduction

In earlier chapters, we learned about templates that are used to create functions and classes that work with arbitrary types. This avoids duplication of work. However, using templates is not applicable in all cases, or may not be the best approach. The limitation of templates is that their types need to be known when the code is compiled.

In real-world cases, ...

Get C++ Fundamentals 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.