Returning to beginning of file after getline
<p>So i've read all the lines from a file thusly</p>

<pre><code>while (getline(ifile,line))
    {
        // logic
    }
</code></pre>

<p>Where ifile is an ifstream and line is a string</p>

<p>My problem is I now want to use getline over again, and seem to be unable to return to the beginning of the file, as running</p>

<pre><code>cout &lt;&lt; getline(ifile,line);
</code></pre>

<p>Will return 0</p>

<p>I've attempted to use:</p>

<pre><code>ifile.seekg (0, ios::beg);
</code></pre>

<p>To no avail, it seems to have no effect. How do I go back to the start of the file?</p>
