title: C++ ifstream class get() method returns the character?
body: <p>I have this code</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;fstream&gt;
  
  using namespace std;
  
  int main(int argc, char **argv) {
      ifstream in;
      in.open(*(argv+1));
      char c;
  
      while (true) {
          if (in.eof())
              break;
          c = in.get();
          cout &lt;&lt; c;
      }
      in.close();
  
      return 0;
  }
  </code></pre>
  
  <p>I read the file which is passed via the command line as the first argument.
  While reading the file, I get the char '?' as the last one. Why?</p>
  
  <p>If I remove this line</p>
  
  <pre><code>in.open(*(argv+1));
  </code></pre>
  
  <p>I will get only the char '?'.</p>