Only variables which have to remember important shared values should normally be declared in this way, since they can cause confusing name clashes. If a function uses a local variable with the same name as a global, the name refers to the name inside the function. If you forget this and try to access the global variable, the effect may not be what you intended. It is also dangerous since the value may change unpredictably as far as any one function is concerned. If you need to use global statics use names which are unlikely to be confused with local variables and whose intended use is clear.
Next - External items.
Back to Contents page.