Module 18: Inheritance

Markdown

View as Markdown

Module Overview

This module introduces inheritance in C++ programming and explains how classes can derive properties and behaviours from other classes.

Learners will explore different types of inheritance and understand how inheritance supports code reuse and the development of structured object-oriented programs.

The module also covers virtual base classes, abstract base classes, and the role of constructors and destructors in derived classes, helping learners understand how inheritance works in more advanced C++ programming scenarios.

What Will Be Covered

18.1 Types of Inheritance

Explore the different types of inheritance used in C++ programming. Understand how classes can inherit from other classes and how inheritance relationships are structured to support code reuse and object-oriented design.

18.2 Virtual Base Classes and Abstract Base Classes

Understand the concepts of virtual base classes and abstract base classes in C++. Learn how virtual base classes help address inheritance-related structures and how abstract base classes provide a foundation for defining interfaces and common behaviour for derived classes.

18.3 Constructor and Destructor in Derived Class

Learn how constructors and destructors work in derived classes. Understand how constructors are involved in object initialisation across inheritance hierarchies and how destructors support object cleanup when derived objects are destroyed.

Skills You Will Gain

  • Understanding inheritance in C++.

  • Identifying different types of inheritance.

  • Working with virtual base classes.

  • Understanding abstract base classes.

  • Managing constructors in derived classes.

  • Understanding destructors in inheritance hierarchies.

Learning Outcomes

By the end of this module, learners will be able to:

  • Explain the concept and purpose of inheritance in C++.

  • Identify and implement different types of inheritance.

  • Understand the role of virtual base classes.

  • Work with abstract base classes.

  • Understand constructor behaviour in derived classes.

  • Explain how destructors work within inheritance hierarchies.

Certification Alignment

This module develops inheritance and advanced object-oriented programming concepts that support the development of structured and reusable C++ applications. The concepts covered contribute to the programming skills learners build throughout the C and C++ training curriculum.

Continue to the Next Module

Continue to Module 19: Working with Files to learn about file operations, file pointers, file pointer manipulation and updating files using random-access techniques.

Was this article helpful?

Still need help?

Contact us

C & C++ Programming

C & C++ Programming

Program RoadmapC,C++ Course Features C & C++ Prerequisites & Installation GuideGetting Started with C: Program Structure, Compilation, Execution, and DebuggingModule 1: Introduction to Programming LanguagesModule 2: C TokensModule 3: Control Statements and ExpressionsModule 4: LoopingModule 5: Arrays and StringModule 6: FunctionsModule 7: PointersModule 8: Structures and UnionsModule 9: File Handling Using CModule 10: Dynamic Memory AllocationModule 11: Storage Classes and Pre-processorModule 12: Introduction to Object-Oriented ProgrammingModule 13: C++ Tokens and Type CastingModule 14: Classes and ObjectsModule 15: Functions in C++Module 16: Constructors and DestructorModule 17: Operator OverloadingModule 18: InheritanceModule 19: Working with FilesModule 20: Exception HandlingUnderstanding C Tokens: Variables, Data Types, Constants, Operators, Scope, and LifetimeHow to Use Control Statements and Loops in CWorking with Arrays and Strings in CUnderstanding Functions in C: User-Defined Functions, Library Functions, and Parameter PassingUnderstanding Pointers in C: Pointer Basics, Pointer Arithmetic, Arrays, and FunctionsWorking with Structures and Unions in CFile Handling in C: Reading, Writing, Updating, and Managing FilesIntroduction to Object-Oriented Programming (OOP) and C++ BasicsUnderstanding C++ Tokens, Data Types, Operators, and Type CastingUnderstanding Classes and Objects in C++Working with Functions in C++: Overloading, Default Arguments, Inline, Static, Friend, and Virtual FunctionsUnderstanding Constructors and Destructors in C++Operator Overloading in C++Understanding Inheritance in C++