tell cin to stop reading at newline
<p>Suppose I want to read line a of integers from input like this:</p>

<pre><code>1 2 3 4 5\n
</code></pre>

<p>I want cin to stop at '\n' character but cin doesn't seem to recognize it.</p>

<p>Below is what I used.</p>

<pre><code>vector&lt;int&gt; getclause() {
  char c;
  vector&lt;int&gt; cl;

  while ( cin &gt;&gt; c &amp;&amp; c!='\n') {    
    cl.push_back(c);
    cin&gt;&gt;c;
  }
  return cl;
}
</code></pre>

<p>How should I modify this so that cin stop when it see the '\n' character?</p>
