title: Printing to output window in Visual Studio
body: <p>I'm pretty new to C++ and recently switched from compiling in g++ on Linux to Visual Studio. I was trying to write a simple program to test some like this:</p>
  
  <pre><code>#include &lt;iostream&gt;
  
  void main()
  {
      // Things
  }
  </code></pre>
  
  <p>And I was using <code>cout &lt;&lt;</code> to display what the function returns, before I realized that it doesn't work this way to print to the output window in Visual Studio. I know I can use the debug mode, but is there a way in Visual Studio to display output to the window? One of the older posts that I found suggested using OutputDebugString, but I didn't write the code as Win32 application, and I think this function doesn't exist for simple cpp files.</p>
  
  <p>Also, is there a reason why a black window pops up when the program is executed, and then immediately disappears?</p>