Static data members and functions

( 1) Static data members between instances of the same class can be shared, if you do not share it, it can be as private or protected.

(2) static member function can be invoked through the class name and the object name,

(3) static member function can directly access static data and function members of the class, and access non-static members must pass the object name.

(4) when the modified static global variables and functions, global variables, and the function can only be used in the present document.

(5) is modified static member function is not allocated space.

(6) is modified static data member outside the class initialization, accessed through the class name.

(7) call is modified static member functions (class name :: function name ()).

(8) this pointer is not static member functions, because it does not belong to any one specific object.

(9) static member function can not be declared virtual or volatile.

Guess you like

Origin www.cnblogs.com/yuanqiangfei/p/11248169.html