In what scenarios crash happens before control comes to main() function?
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/2518415/is-there-any-way-a-c-c-program-can-crash-before-main">Is there any way a C/C++ program can crash before main()?</a>  </p>
</blockquote>



<p>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.</p>

<p>Possible solution: Use functions to get static pointer values, so that they can initialize and return proper pointers.</p>

<p>I read slightly similar thread at
<a href="http://stackoverflow.com/questions/2814779/program-crashes-in-debugger-before-anything-happens">http://stackoverflow.com/questions/2814779/program-crashes-in-debugger-before-anything-happens</a></p>

<p>I am looking for more information.
Are there any other scenarios for such crash ? 
and Whats the solution for avoiding such crashes ?</p>
