C++ getline and gcount
<p>Suppose I have an <code>std::istream</code> pointing to the following contents (the line break is a <code>'\n'</code> character):</p>

<pre><code>12345678
9
</code></pre>

<p>and run the following code:</p>

<pre><code>std::istream &amp; is = ...
char buff[9];
is.getline(buff, 9);
int n = is.gcount();
</code></pre>

<p>Now <code>n == 8</code> and <code>strcmp(buff, "12345678") == 0</code>. The question is, how do I know that I read the entire line instead of some of the line?</p>

<p>If the steam instead points to the following contents:</p>

<pre><code>123456789
0
</code></pre>

<p>and the same code is executed, I am still on the same line. How do I differentiate between these two cases?</p>
