1. Class data members: static and nonstatic, class member functions: static, nonstatic, virtual, and pure-virtual. It
Their differences are:
1) static data member belongs to the class, while nonstatic data member belongs to the specific object of the class. Static data member needs to be determined by yourself
Definition, so the class already exists in the memory before it is instantiated.
Static data member is defined as: <data type> <class name >:: <static data member name >=< value>
Reference: <Class Object Name>. <static data member name> or <class name >:< static data member name>
Reference static member funtion: <class name >:< static member function name> (<parameter table>) or <Class Object Name>. <static member function name> (
<Parameter table>)
2) if a class contains the pure-virtual function, the class is an abstract class and cannot be instantiated. You can use virtual functions in the base class to implement a function.
Define your own implementation methods in the derived class to achieve polymorphism.
3) static member functions are the same as static data member functions. They all belong to static members of the class and are not object members. Therefore
You do not need to use an object name to reference a member. Static member functions can only directly access static data members because they cannot obtain the this pointer.