0% found this document useful (0 votes)
1 views7 pages

C++ OOP - Class Inheritance

The document discusses the concept of inheritance in C++ programming, explaining the relationship between base (parent) and derived (child) classes. It provides an example of a Rectangle class inheriting properties from a Shape class. Additionally, it mentions access control for inherited classes and references specific header and implementation files related to the example.

Uploaded by

vinnoval123
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
1 views7 pages

C++ OOP - Class Inheritance

The document discusses the concept of inheritance in C++ programming, explaining the relationship between base (parent) and derived (child) classes. It provides an example of a Rectangle class inheriting properties from a Shape class. Additionally, it mentions access control for inherited classes and references specific header and implementation files related to the example.

Uploaded by

vinnoval123
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 7

C++ Programming

Class Inheritance
What is Inheritance?
Base and Derived Class
Representation of Inheritance

Base Class or Parent Class

Derived Class or Child Class

Rectangle class inherits the properties of Shape


class
Rectangle class can use the properties of Shape
Access control of inherit classes
Example
Shape.h
Rectangle.h

Rectangle class
inherits the Shape class
Shape.cpp main.cp
p

Rectangle.cp
p

You might also like