Day 12. Implementing Inheritance

Yesterday, you learned about a number of object-oriented relationships, including specialization/generalization. C++ implements this relationship through inheritance.

Today, you will learn

• The nature of what inheritance is

• How to use inheritance to derive one class from another

• What protected access is and how to use it

• What virtual functions are

What Is Inheritance?

What is a dog? When you look at your pet, what do you see? I see four legs in service to a mouth. A biologist sees a network of interacting organs, a physicist sees atoms and forces at work, and a taxonomist sees a representative of the species canine domesticus.

It is that last assessment that is of interest at the moment. A dog is a kind ...

Get Sams Teach Yourself C++ in 21 Days , Fifth 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.