title: showing -1 while getting the position of get_pointer
body: <pre><code>#include&lt;fstream&gt;
  #include&lt;iostream&gt;
  using namespace std;
  int main()
  {   ifstream fin;
      fin.open("pro.txt");
      char ch;
      while(!fin.eof())
      {
        fin.get(ch);
        cout&lt;&lt;ch;
      }
      fin.seekg(0);
      int pos=(int)fin.tellg();
      cout&lt;&lt;"\n pointer is at :"&lt;&lt;pos;
      fin.close();
      return 0;
  }
  </code></pre>
  
  <p>content of file pro.txt</p>
  
  <pre><code>this is the test file text
  </code></pre>
  
  <p>even after fin.seek(0) the position of get_pointer returned by fin.tellg() is always -1 (WHY ?). it happens only when i read the file till the eof(). HELP</p>
  
  <p>output</p>
  
  <pre><code>this is the test file text
  pointer is at: -1
  </code></pre>