Is it well-defined behaviour to exit the program before main?
问题 It's definitely possible to execute code before main is called, as seen by many examples in this question. However, what if in that pre-main code, the program is told to exit via std::exit or std::abort ? Since main is defined as the start of a program, what consequences are there from exiting before the start? Upon printing something in each section, I get the following results: Format: Section : output Main : main Init (called before main) : init Exit (set up with std::atexit inside Init) :