Professional Documents
Culture Documents
Objective
}
in.close();
More I/O Functions
put() and get() function:The function put() writes a single character to the
associated stream. Similarly, the function get() reads a single character form
the associated stream.
Prototypes:
istream &get(char &ch);
ostream &put(char ch);
write() and read() function: write() and read() functions write and read
blocks of binary data to/from files.
Prototypes:
istream &read(char *buf, streamsize num);
ostream &write(const char *buf, streamsize num);
Random Access:
istream &seekg(off_type offset, seekdir origin);
ostream &seekp(off_type offset, seekdir origin);
Here origin can be any of ios::beg ,ios::cur or ios::end.