title: How to check if there isn't data in file to read
body: <pre><code> std::fstream fin("emptyFile", std::fstream::in);
   std::cout &lt;&lt; fin.eof() &lt;&lt; std::endl;
  </code></pre>
  
  <p>This prints <code>0</code>. So using <code>eof</code> function I can't check if file is empty. Or after reading some data I need to check if there is no more data in it.</p>