title: `fin.get(ch);` reads last character twice while `ch=fin.get();` not inside `while(!fin.eof())` loop why?
body: <p><strong>vicky.txt file</strong></p>
  <pre><code>I was born in Hupari.
  </code></pre>
  <p><strong>Code -1</strong></p>
  <pre><code>#include &lt;iostream&gt;
  #include&lt;fstream&gt;
  int main()
  {
      char ch;
      std::ifstream fin;
      fin.open(&quot;vicky.txt&quot;, std::ios::in);
  
      while (!fin.eof())
      {
          fin.get(ch);
          std::cout&lt;&lt;ch;
      }
      fin.close();
      return 0;
  }
  </code></pre>
  <p><strong>Output</strong></p>
  <pre><code>I was born in Hupari..
  </code></pre>
  <p><strong>Code -2</strong></p>
  <pre><code>#include &lt;iostream&gt;
  #include&lt;fstream&gt;
  int main()
  {
      char ch;
      std::ifstream fin;
      fin.open(&quot;vicky.txt&quot;, std::ios::in);
  
      while (!fin.eof())
      {
          ch=fin.get();
          std::cout&lt;&lt;ch;
      }
      fin.close();
      return 0;
  }
  </code></pre>
  <p><strong>Output</strong></p>
  <pre><code>I was born in Hupari. 
  </code></pre>
  <p>Why while using <code>fin.get(ch)</code> it reads last character twice. On other hand <code>ch=fin.get()</code> reads correctly means reads last character one time only.</p>
  <p>By the way also tell return type of <code>fin.get(ch)</code> ? and return type of <code>fin.get()</code> is <code>char</code> right ?</p>