1 General class static member functions cannot call non-static member functions
2 can a static member function call a constructor?
The answer is yes, because the static member function does not have this pointer, the general static member function cannot access the Non-static member, including member functions and member variables.
Because of the particularity of the constructor, it constructs an object from scratch, so calling it does not require a instance, that is, it does not require the this pointer to be called, so the constructor can be called in the static function.
The O constructor is divided into two stages:
1. Allocating memory: This is the beginning of the phase, the end of the phase, resulting in a instance, also known as this.
2. Initialize Memory: the part that actually calls the constructor. The constructor is already called on the instance, so any non-static functions can be called.
o in a static function, as long as it is through instance. Func () or Pointer->func () can call a non-static function because this is explicitly specified.
Therefore, it is advocated to display the use of this in all non-static member functions using the member.
The static member function cannot call the Non-static member function