c++ - Use of static private attributes -


I am having trouble understanding the use of private static properties in class:

-> Personal It means that the qualities will be accessible only by the class if I am right.

-> Static indicates that the qualities are related to yourself, not the object and if I am still right, P>

Therefore, I can not think of any use of a personal stable feature.

Thanks in advance for any help :)

Kenshin

You said to yourself: If you want a variable associated with the class, but not part of any object ( stable ), which can only be accessed within orbit (< Code> private ).

As a concrete example, here is a class that is itself:

  class countable {private: stable unsigned count; Public: Countable () {++ count;} Calculable (Math and Calculations) {++ Calculation;} ~ Mathematical () {--;;} Stable Unsigned Example Mathematics (Return of calculation;}};  

Comments