title: cin.get() in a loop
body: <p>I was trying to read from standard input. The first line is the number of lines that I will read. The lines that I read next will be printed again. Here is the code:</p>
  
  <pre><code>#include &lt;iostream&gt;
  
  using namespace std;
  
  int main()
  {
      int n;
      cin &gt;&gt; n;
      for (unsigned int i = 0; i &lt; n; ++i)
      {
          char a[10];
          cin.get (a, 10);
          cout &lt;&lt; "String: " &lt;&lt; a &lt;&lt; endl;
      }
      return 0;
  }
  </code></pre>
  
  <p>When I run it and give number of lines, the program exits. I haven't figured out what's going on, so I've decided to ask it here.</p>
  
  <p>Thanks in advance.</p>