The constructor for a static
local object is called only once, when execution first reaches the point where the object is defined—the corresponding destructor is called when main
terminates or the program calls function exit
. Global and static
objects are destroyed in the reverse order of their creation. Destructors are not called for static
objects if the program terminates with a call to function abort
.