title: The C++ program should exit as soon as he presses 'esc'
body: <p>I have a program in which there is a code which looks something like this:</p>
  
  <pre><code>int Element[15];
  cout &lt;&lt; "Enter name/symbol of the Element: ";
  cin &gt;&gt; Element;
  </code></pre>
  
  <p>and I want the program to exit as soon as he presses <em>'esc'</em> key. And also the user should not have to press the <em>'enter'</em> key after pressing the <em>'esc'</em> key. So how to do that??</p>