I/O manipulators | ||||
Print functions(C++23) | ||||
C-style I/O | ||||
Buffers | ||||
(C++23) | ||||
(C++98/26*) | ||||
(C++20) | ||||
Streams | ||||
Abstractions | ||||
File I/O | ||||
String I/O | ||||
Array I/O | ||||
(C++23) | ||||
(C++23) | ||||
(C++23) | ||||
(C++98/26*) | ||||
(C++98/26*) | ||||
(C++98/26*) | ||||
Synchronized Output | ||||
(C++20) | ||||
Types | ||||
Error category interface | ||||
(C++11) | ||||
(C++11) |
|
|
std::streamsize sgetn( char_type* s,std::streamsize count); | (1) | |
protected: virtualstd::streamsize xsgetn( char_type* s,std::streamsize count); | (2) | |
xsgetn(s, count)
of the most derived class.count
characters from the input sequence and stores them into a character array pointed to bys
. The characters are read as if by repeated calls tosbumpc(). That is, if less thancount
characters are immediately available, the function callsuflow() to provide more untilTraits::eof() is returned.std::basic_streambuf
are permitted to provide more efficient implementations of this function.Contents |
s | - | pointer to the beginning of a char_type array |
count | - | maximum number of characters to read. |
The number of characters successfully read. If it is less thancount
the input sequence has reached the end.
The rule about "more efficient implementations" permits bulk I/O without intermediate buffering: that's howstd::ifstream::read simply passes the pointer to the POSIXread()
system call in some implementations of iostreams
This section is incomplete Reason: no example |
invokesxsputn() (public member function)[edit] |