title: C++ keypress: getch, cin.get?
body: <p>I have a Win32 program that runs on a loop. I would like to be able to pause that program while awaiting a keypress. It doesn't matter whether I use 'any key' or a specific key, but I need to have the program freeze until I press something.</p>
  
  <p>I am wondering which command I should use. I am working with Visual C++ and the compiler doesn't recognise any of the following commands:</p>
  
  <pre><code>cin.get()
  
  std::cin.get()
  
  getch()
  </code></pre>
  
  <p>I am relatively new to C++. I understand that in a console app this is a fairly simple action to take (cin.get), but that it can be more difficult in Win32. Any simple solution or workaround would be appreciated. The program is bespoke to be used in a single scientific experiment, so for now I'm not fussed if the solution is a little botchy(!)</p>
  
  <p>Apologies if I've missed any important info from my question.</p>