cplusplus.com cplusplus.com
cplusplus.com   C++ : Reference : IOstream Library : istream : gcount
- -
C++
Information
Documentation
Reference
Articles
Sourcecode
Forum
Reference
C Library
IOstream Library
Strings library
STL Containers
STL Algorithms
IOstream Library
manipulators
classes:
· filebuf
· fstream
· ifstream
· ios
· iostream
· ios_base
· istream
· istringstream
· ofstream
· ostream
· ostringstream
· streambuf
· stringbuf
· stringstream
objects:
· cerr
· cin
· clog
· cout
types:
· fpos
· streamoff
· streampos
· streamsize
istream
· istream::istream
· istream::~istream
member classes:
· istream::sentry
member functions:
· istream::gcount
· istream::get
· istream::getline
· istream::ignore
· istream::operator>>
· istream::peek
· istream::putback
· istream::read
· istream::readsome
· istream::seekg
· istream::sync
· istream::tellg
· istream::unget

-

istream::gcount public member function
streamsize  gcount ( ) const;

Get number of characters extracted by last unformatted input operation

Returns the number of characters extracted by the last unformatted input operation performed on the object.

The unformatted input operations that modify the value returned by this function are those performed by the following member functions: get, getline, ignore, peek, read, readsome, putback and unget.

Notice though, that peek, putback and unget do not extract characters. So gcount will always return zero after a call to any of these.

Parameters

none

Return Value

An integer value of type streamsize with the number of characters extracted by the last unformatted input operation.

Basic template member declaration

( basic_istream<charT,traits> )
streamsize gcount () const;

See also

istream::get Get unformatted data from stream (public member function)
istream::getline Get line from stream (public member function)
istream::ignore Extract and discard characters (public member functions)
istream::read Read block of data (public member function)
istream::readsome Read block of data available in the buffer (public member function)

© The C++ Resources Network, 2000-2007 - All rights reserved
Spotted an error? - contact us