4 static

The static has various meanings in C/C++. A static global variable is one that has a scope of the object file, but it cannot be seen by other object files. A static local variable is one that is created statically, but has a local scope to limit its visibility.

A class may contain static data members. This ``overloading'' of the meaning of static can be confusing. A static data member of a class is a data member that belongs to the class itself, and it does not belong to any individual object of the class.



Subsections

Copyright © 2006-09-19 by Tak Auyeung