What is the function of the virtual base class in C language and C++
This article mainly introduces "what is the role of virtual base classes in C language and C++". In daily operation, I believe that many people have doubts about the role of virtual base classes in C language and C++. The editor consulted all kinds of materials and sorted out simple and easy-to-use methods of operation. I hope it will be helpful to answer the doubts about "what is the role of virtual base classes in C language and C++". Next, please follow the editor to study!
Catalogue
Overview
The problem of multiple inheritance
Virtual base class
Initialization
Examples
Overview
The virtual base class (virtual base class) is the parent class that declares inheritance with the keyword virtual.
The problem of multiple inheritance
Category N:
Class N {public: int a; void display () {cout