title: ifstream, end of line and move to next line?
body: <p>how do i detect and move to the next line using std::ifstream?</p>
  
  <pre><code>void readData(ifstream&amp; in)
  {
      string sz;
      getline(in, sz);
      cout &lt;&lt; sz &lt;&lt;endl;
      int v;
      for(int i=0; in.good(); i++)
      {
          in &gt;&gt; v;
          if (in.good())
              cout &lt;&lt; v &lt;&lt; " ";
      }
      in.seekg(0, ios::beg);
      sz.clear();
      getline(in, sz);
      cout &lt;&lt; sz &lt;&lt;endl; //no longer reads
  }
  </code></pre>
  
  <p>I know good would tell me if an error happened but the stream no longer works once that happens. How can i check to see if i am at the end of line before reading another int?</p>