title: Is there a decent wait function in C++?
body: <p>One of the first things I learned in C++ was that</p>
  
  <pre><code>#include &lt;iostream&gt;
  int main()
  {
      std::cout&lt;&lt;"Hello, World!\n";
      return 0;
  }
  </code></pre>
  
  <p>would simply appear and disappear extremely quickly without pause. To prevent this, I had to go to notepad, and save</p>
  
  <pre><code>helloworld.exe
  pause
  </code></pre>
  
  <p>ase</p>
  
  <pre><code>helloworld.bat
  </code></pre>
  
  <p>This got tedious when I needed to create a bunch of small test programs, and eventually I simply put <code>while(true);</code> at the end on most of my test programs, just so I could see the results. Is there a better wait function I can use?</p>