1. Abstract classes containing pure virtual functions
2. Pure virtual Functions in abstract classes (usually base classes) are not related to the implementation of the function body or not, and the system automatically ignores
3. Inheriting from a subclass of an abstract class, you must implement a pure virtual function of the parent class to instantiate the object
4. Abstract classes do not allow instantiating objects and can only be used as a base class or virtual interface
5. Pointers to abstract classes can point to different derived class objects (functions of virtual functions)
class father{ public: virtualvoid0int10 ; }; // pure virtual function in abstract class, function body implementation is also equivalent to not implemented, automatic ignoring }; Father F; // error, abstract class (class containing pure virtual function), not allowed to instantiate
6. Ordinary function, friend function, constructor can not be virtual function, other member function, destructor can be virtual function
Analysis:
A. Ordinary functions and friend functions are not members of a class, so there is no concept of virtual functions
B. If the constructor is a virtual function, in the case of inheritance, only the subclass will be constructed and the parent class will not be constructed, obviously not
C. In the case of virtual inheritance, where multiple inheritance produces diamond inheritance, virtual inheritance can prevent the common base class from being repeatedly constructed
D. A virtual destructor is a destructor for a derived class that is called when an object of a derived class is deleted with a pointer to a base class.
The implementation of abstract classes and pure virtual functions in C + +