title: how interrupt c++ run without typing neither CTRL-C nor introducing cin or system-pause?
body: <p>I need to do very long simulation, let's say this:</p>
  
  <blockquote>
    <p>int i;</p>
    
    <p>vector result;</p>
    
    <p>while(true)</p>
    
    <p>{</p>
    
    <p>i = random(8);</p>
    
    <p>if (i &lt; 4) {result.push_back(i);}</p>
    
    <p>}</p>
    
    <p>cout &lt;&lt; result;</p>
  </blockquote>
  
  <p>Is there a way to stop this while loop from console doing something (e.g. pressing a key) without typing CTRL-C or without introducing a cin or system-pause function?
  I'd like to let this while loop going on until I decide to stop it!</p>