title: C++ ifstream read offset range
body: <p>I work an file, in this file content: "hello_READHERE_guys". How to read "READHERE" position only?</p>
  
  <p>I trying this code and fail: </p>
  
  <pre><code>std::ifstream is("test.txt");
  
  if (is.good())
  {
      is.seekg(5, ios::end); // step from end "_guys"
      is.seekg(6, ios::beg); // step from start "hello_"
  
      std::string data;
  
      while (is &gt;&gt; data) {}
  
      std::cout &lt;&lt; data &lt;&lt; std::endl; // output "READHERE_guys" fail.
  }
  </code></pre>