C++ basic_ios Library - readsome


Advertisements

Description

It is used to read data available in buffer.

Declaration

Following is the declaration for std::basic_istream::readsome.

streamsize readsome (char_type* s, streamsize n);

Parameters

  • n − Maximum number of characters to write to s (including the terminating null character).

  • s − Pointer to an array where the extracted characters are stored.

Return Value

Returns the number of characters stored.

Exceptions

Basic guarantee − if an exception is thrown, the object is in a valid state.

Data races

Modifies the elements in the array pointed by s and the stream object.

istream.htm
Advertisements