How does getline() actually behave?
<p>I have 2 questions:</p>

<ol>
<li><p>What happens to s if I again do a "getline(in,line)" after the while loop ends?</p>

<pre><code>ifstream in("string.txt");
string s, line;
s = "";
while(getline(in,line))
{

    s = s + line + "\n";

}

cout&lt;&lt;s&lt;&lt;endl&lt;&lt;"******************************************"&lt;&lt;endl;
</code></pre></li>
<li><p>The getline() function: everytime it is called, does it goes to the "next" line of the ifstream "in" object in the above code? If so what happens when the while loop ends and I call the same function again? (almost the same as first question, just a subtle difference)               </p></li>
</ol>
