Controlling the Initialization of File-Scope Objects in C++

01 January 1990

New Image

One way that C++ extended C is to allow objects in the file- scope ('global variables') to be initialized by expressions that are dynamically evaluated at the beginning of program execution. This feature was originally limited to the use of constructors to initialize instances of classes, but in C++ 2.0, this capability has been extended to allow any file-scope object to be initialized by an arbitrary expression.