Inheritance Programs

Virtual base class program in c++

Virtual base class program

Virtual base class program in c++.Declaring base class as a virtual class takes necessary care to see that only one copy of that class is inherited.This program is also a example of hybrid inheritance. Here class scan1 is a base class.

Virtual base class program

Program

OUTPUT

Virtual base class program


Comment below if you are facing any problem.


Also read

C++ program of multilevel inheritance
Hierarchical inheritance program in c++
Multiple inheritance program in c++

Summary
Virtual base class program in c++
Article Name
Virtual base class program in c++
Description
Declaring base class as a virtual class takes necessary care to see that only one copy of that class is inherited.
Author
Publisher Name
Scanfcode
Publisher Logo