title: Stop entering values into array when enter is pressed
body: <p>Hello guys I'm having trouble trying to implement the enter key part of my program </p>
  
  <pre><code>int list[50];
  int i = 0;
  while (/*enter key has not been pressed*/&amp;&amp; i &lt; 50){
    cin&gt;&gt;list[i];
    i++;
    }
  </code></pre>
  
  <p>How its supposed to work is, it will take in integers separated by spaces and store them into the array. It should stop accepting input when the enter key has been pressed.</p>
  
  <p>PS I'm posting this from my phone that's why I can't format the text properly. If there's any problem with syntax, it could probably just be ignored setting as I'm only concerned with the"enter key" part.</p>