A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://en.cppreference.com/w/cpp/language/../error/../io/basic_streambuf/sgetn.html below:

std::basic_streambuf<CharT,Traits>::sgetn, std::basic_streambuf<CharT,Traits>::xsgetn - cppreference.com

1) Calls xsgetn(s, count) of the most derived class.

2)

Reads

count

characters from the input sequence and stores them into a character array pointed to by

s

. The characters are read as if by repeated calls to

sbumpc()

. That is, if less than

count

characters are immediately available, the function calls

uflow()

to provide more until

Traits::eof()

is returned.

Classes derived from std::basic_streambuf are permitted to provide more efficient implementations of this function.

[edit] Parameters s - pointer to the beginning of a char_type array count - maximum number of characters to read. [edit] Return value

The number of characters successfully read. If it is less than count the input sequence has reached the end.

[edit] Notes

The rule about "more efficient implementations" permits bulk I/O without intermediate buffering: that's how std::ifstream::read simply passes the pointer to the POSIX read() system call in some implementations of iostreams

[edit] Example [edit] See also

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4