std::basic_istream<CharT,Traits>::read (3) - Linux Man Pages
basic_istream& read( char_type* s, std::streamsize count );
Extracts characters from stream.
Behaves as UnformattedInputFunction. After constructing and checking the sentry object, extracts characters and stores them into successive locations of the character array whose first element is pointed to by s. Characters are extracted and stored until any of the following conditions occurs:
* count characters were extracted and stored
* end of file condition occurs on the input sequence (in which case, setstate(failbit|eofbit) is called). The number of successfully extracted characters can be queried using gcount().
s - pointer to the character array to store the characters to
count - number of characters to read
failure if an error occurred (the error state flag is not goodbit) and exceptions() is set to throw for that state.
If an internal operation throws an exception, it is caught and badbit is set. If exceptions() is set for badbit, the exception is rethrown.
When using a non-converting locale (the default locale is non-converting), the overrider of this function in std::basic_ifstream may be optimized for zero-copy bulk I/O (by means of overriding std::streambuf::xsgetn)
// Run this code
write (public member function of std::basic_ostream<CharT,Traits>)
operator>> (public member function)
readsome (public member function)
get (public member function)
getline (public member function)