cin.gcount() and its applications
<p>I wrote the following code</p>

<pre><code>#include&lt; iostream&gt;  
using namespace std;  
int main()  
{  
 char a[30];  
 cin.read(a,10);  
 cout&lt;&lt;(cin.gcount());  
  system("pause");  
  return 0;     
}  
</code></pre>

<p>the output was 10 as expected....but then i wrote the following code</p>

<pre><code>#include&lt; iostream&gt;    
using namespace std;   
int main()    
{    
 char a[30];    
 cin&gt;&gt;a;   
 cout&lt;&lt;(cin.gcount());    
  system("pause");    
  return 0;       
}   
</code></pre>

<p>I entered "hello" which got stored in a.... the output this time was 0 instead of 5...if cin.gcount() returns the number of bytes read in last input operation, why this difference    </p>
