- In this type of inheritance one derived class inherits from only one base class.
- It is the most simplest form of Inheritance.
- Single inheritance represents a form of inheritance when there is only one base class and one derived class.
class derived_class_name: visibility_mode base_class_name
:::::::::::::: // member of derived class
// Base class
void setWidth(int w)
width = w;
void setHeight(int h)
height = h;
// Derived class
class Rectangle: public Shape
return (width * height);
// Print the area of the object.
cout << "Total area: " << Rect.getArea() << endl;