title: Ifstream.get reads only first line
body: <p>I have the following program</p>
  
  <pre><code>ifstream input;
  input.open("File.txt",ios::in);
  while(input){
      char arr[30];
      input.get(arr,30);
      cout &lt;&lt; arr;
  }
  </code></pre>
  
  <p>My file is </p>
  
  <pre><code>A 100
  B 200
  </code></pre>
  
  <p>However, my output has only the first line, that is <code>A 100</code>. When I replace <code>.get</code> with <code>.getline</code> it works as expected.</p>
  
  <p>I did some <a href="https://stackoverflow.com/questions/26873401/difference-between-cin-get-and-cin-getline">searching</a> and found that <code>.get</code> keeps the <code>\n</code> in the stream, while <code>.getline</code> removes it altogether. </p>
  
  <p>Is that the reason why I'm getting only the first line? If it is, how do I fix it?</p>