About C ++ data structures

1. The access speed is far greater than the temporary variable member variables.

2.C ++ in the only function return value can be left to do is reference value, in essence, is a pointer.

3. const member functions plus end, member functions for read-only, can not change the value of a member variable. Read-only member function calls only for read-only objects.

4. Read-only member variables can only be assigned in the constructor initializer list.

5. ordinary global variables across files, using extern keyword to refer to, static global variables can not.

6. static member variables within the class in name only belong to the class, the class does not include space for static member variables, addresses static member variables in the global zone, within the class declaration, defined outside the class (to remove the static keyword), you can call the object , or by class name calling; this is not a static member function pointers, nominally belong to the class of all, it is essentially a global function.

 

Guess you like

Origin www.cnblogs.com/wyj510/p/10909498.html