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-fe7468ce66024b728aad8f31cd14d6f3-77244b7fc0114499a2f0b12fa5f57173
Requirements
Header: <istream>
Namespace: std