title: Executing code before main()
body: <p>In object-oriented languages (C++) you can execute code before <code>main()</code> by using a global object or a class static object and have their constructors run the code you want.</p>
  
  <p>Is there any way to do this in C? I don't have any specific problem I'm trying to solve, I'm just curious. One thing this might be useful for is automatically initializing a library.  </p>