Perhaps your question is really only about C++, and not about C at all...

In C, none of your code is ever executed before the first line of code in main.

In C++, all global objects are constructed some time prior to the first line of code in main. That's all you need to know, apart from perhaps being aware of the 'static initialisation order' problem.