O'Reilly logo

C++ Without Fear: A Beginner’s Guide That Makes You Feel Smart, Second Edition by Brian Overland

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

15. Two Complete OOP Examples

If you’ve stayed with me through the last three chapters—I call them “object-oriented boot camp”—then congratulations! I’ve taken you through a number of the subtleties of writing C++ classes, complete with constructors and operator functions.

But now it’s time to have some fun with classes! In this chapter, we’ll use classes to implement a customized linked list and to animate the Tower of Hanoi puzzle solution from Chapter 4.

Introducing Linked Lists

We’ve been able to use arrays to do quite a lot. With dynamic memory allocation, arrays can even be given a size determined at runtime. But there are still limitations: Once fixed, the length of an array can’t be changed without destroying the array and starting over. ...

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