title: Using an ASCII value as a condition
body: <p>The following program should read some integer values from input and store them into an array until the user presses "Esc" key, but i cannot figure out how to do that. I have tried to use it's ASCII value as a condition but it doesn't work, or I'm doing something wrong.Could somebody please help me? Here is the code :</p>
  
  <pre><code>    void main(){
  int i=0, a[MAX];
  cout &lt;&lt;"Please enter several integer numbers and press Esc when you want to finish" &lt;&lt; endl;
  while ((i != char(27)) &amp;&amp; (i &lt; MAX)) {
       cin &gt;&gt; a[i];
      i++;
  }
  </code></pre>