std::basic_istream<CharT,Traits>::gcount (3) - Linux Manuals
std::basic_istream<CharT,Traits>::gcount: std::basic_istream<CharT,Traits>::gcount
Command to display std::basic_istream<CharT,Traits>::gcount
manual in Linux: $ man 3 std::basic_istream<CharT,Traits>::gcount
NAME
std::basic_istream<CharT,Traits>::gcount - std::basic_istream<CharT,Traits>::gcount
Synopsis
std::streamsize gcount() const;
Returns the number of characters extracted by the last unformatted_input_operation.
The following member functions of basic_istream change the value of subsequent gcount() calls:
* move_constructor
* swap()
* get()
* getline()
* ignore()
* read()
* readsome()
* operator>>(basic_streambuf*)
The following functions set gcount() to zero:
* constructor
* putback()
* unget()
* peek()
Parameters
(none)
Return value
The number of characters extracted by the last unformatted input operation
Example
// Run this code
#include <iostream>
#include <sstream>
int main()
{
char x[20];
std::istringstream stream("Hello World");
stream.read(x, sizeof x);
std::cout << "Characters extracted: " << stream.gcount();
}
Output:
Characters extracted: 11
Pages related to std::basic_istream<CharT,Traits>::gcount
- std::basic_istream<CharT,Traits>::get (3) - std::basic_istream<CharT,Traits>::get
- std::basic_istream<CharT,Traits>::getline (3) - std::basic_istream<CharT,Traits>::getline
- std::basic_istream<CharT,Traits>::basic_istream (3) - std::basic_istream<CharT,Traits>::basic_istream
- std::basic_istream<CharT,Traits>::ignore (3) - std::basic_istream<CharT,Traits>::ignore
- std::basic_istream<CharT,Traits>::operator= (3) - std::basic_istream<CharT,Traits>::operator=
- std::basic_istream<CharT,Traits>::operator>> (3) - std::basic_istream<CharT,Traits>::operator>>
- std::basic_istream<CharT,Traits>::peek (3) - std::basic_istream<CharT,Traits>::peek
- std::basic_istream<CharT,Traits>::putback (3) - std::basic_istream<CharT,Traits>::putback
- std::basic_istream<CharT,Traits>::read (3) - std::basic_istream<CharT,Traits>::read
- std::basic_istream<CharT,Traits>::readsome (3) - std::basic_istream<CharT,Traits>::readsome
- std::basic_istream<CharT,Traits>::seekg (3) - std::basic_istream<CharT,Traits>::seekg
- std::basic_istream<CharT,Traits>::sentry (3) - std::basic_istream<CharT,Traits>::sentry
- std::basic_istream<CharT,Traits>::swap (3) - std::basic_istream<CharT,Traits>::swap
- std::basic_istream<CharT,Traits>::sync (3) - std::basic_istream<CharT,Traits>::sync
- std::basic_istream<CharT,Traits>::tellg (3) - std::basic_istream<CharT,Traits>::tellg
- std::basic_istream<CharT,Traits>::unget (3) - std::basic_istream<CharT,Traits>::unget
- std::basic_istream<CharT,Traits>::~basic_istream (3) - std::basic_istream<CharT,Traits>::~basic_istream
- std::basic_istream (3) - std::basic_istream
- std::basic_istream_sentry (3)
- std::basic_istringstream (3) - std::basic_istringstream