title: How does reading file with while loops work in C++?
body: <p>Why is it possible to read a file using a while loop such as</p>
  
  <pre><code>while (file &gt;&gt; variable)
  </code></pre>
  
  <p>Or</p>
  
  <pre><code>while (getline(xx, yy))
  </code></pre>
  
  <p>Do the <code>&gt;&gt;</code> and <code>getline</code> functions return boolean values ? </p>