title: WinMain not called before main (C/C++ Program Entry Point Issue)
body: <p>I was under the impression that this code</p>
  
  <pre><code>#include &lt;windows.h&gt;
  
  #include &lt;stdio.h&gt;
  
  int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR szCmdLine, int iCmdShow)
  {
      printf("WinMain\n");
  
      return 0;
  }
  
  int main()
  {
      printf("main\n");
  
      return 0;
  }
  </code></pre>
  
  <p>would output WinMain, but of course nothing ever works how you expects.</p>
  
  <p>Anyways, could somebody please tell me how to get this program to run WinMain first (I do have a reason for using both).  I'm running windows 7 with mingw if that helps anything.</p>