#include <iostream>istream &read(char *buf, streamsize num);
The read( ) function is a member of istream.
The read( ) function reads num bytes from the associated input stream and puts them in the buffer pointed to by buf. If the end of the file is reached before num characters have been read, read( ) simply stops, sets failbit, and the buffer contains as many characters as were available. (See gcount( ).) read( ) returns a reference to the stream.
Related functions are gcount( ), readsome( ), get( ), getline( ), and write( ).