Possible Duplicate:
Is there any way a C/C++ program can crash before main()?
Hi, In what scenarios, application crashes before control reaches main() function ? My understanding so far: Global and Global static initialization happen before main(). So if order of initialization is not proper then it could lead crash when using uninitialized pointers etc.
Possible solution: Use functions to get static pointer values, so that they can initialize and return proper pointers.
I read slightly similar thread at http://stackoverflow.com/questions/2814779/program-crashes-in-debugger-before-anything-happens
I am looking for more information. Are there any other scenarios for such crash ? and Whats the solution for avoiding such crashes ?