When you define global variables that are objects of a class, the constructor can be coded to execute before the main program begins to execute. Further, if the class has a destructor, the destructor can be used to "clean up" after the program finishes execution. For example see example consdesc.cpp.
When this type of construction of the class is used, greater control of the environment is possible. It would not be necessary to access machine language code or OS calls to achieve certain results only C++ code could be used. This would therefore make the code more portable