basic_istream::gcount
Returns the number of characters read during the last unformatted input.
streamsize gcount( ) const;
Return Value
The extraction count.
Remarks
Use basic_istream::get to read unformatted characters.
Example
// basic_istream_gcount.cpp
// compile with: /EHsc
#include <iostream>
using namespace std;
int main( )
{
cout << "Type the letter 'a': ";
ws( cin );
char c[10];
cin.get( &c[0],9 );
cout << c << endl;
cout << cin.gcount( ) << endl;
}
a
FakePre-c1497cf9a2784d0a8e6ad74c56d1fb95-6d1fb46df81645edbbc07029c53a2561
Requirements
Header: <istream>
Namespace: std