std::basic_istream::readsome

From Cppreference

Jump to: navigation, search
basic_istream& readsome( char_type* s, streamsize count );

Extracts immediately available characters from the input stream.

If good() != true, setstate(failbit) is called and the function returns. At most count characters are extracted. If end-of-file is encountered earlier, setstate(eofbit is called and the function returns.

Function uses rdbuf()->in_avail() to determine how many characters are available for extraction. Note, that using this function with standard input does not guarantee that the function will not block.

Contents

[edit] Parameters

s - pointer to the character string to store the characters to
count - maximum number of characters to read

[edit] Return value

*this

[edit] Example

[edit] See also

read
extracts blocks of characters
(public member function)