Seeking (Cont.)
void open( const char * filename, openmode mode = ios_base::in | ios_base::out );
This program applies update operations, which are neither read nor write. For update, the openmode
is in
or out
.
streampos tellp( );
It is a method inherited from ostream and returns the position of put pointer, which determines the next location where to write in the buffer associated to the output stream.
streampos tellg( );
It is a method inherited from istream and returns the position of the get pointer.
The get pointer determines the next location to be read in the buffer associated to the input stream.
ostream& seekp( streampos pos );
It is a method inherited from ostream and sets the position of the put pointer.
The put pointer determines the next location where to write in the buffer associated to the output stream.
istream& seekg( streampos pos );
It is a method inherited from istream and sets the position of the get pointer, which determines the next location to be read in the buffer associated to the input stream.
ostream& write( const char* str, streamsize n );
It is a method inherited from ostream and writes a sequence of characters.
Inserts into the output stream a sequence of characters starting by character pointed by str
and following by successive characters in the array until the number of characters specified by n
has been successfully written or until an error occurs in the output sequence.
No check for ending null characters is done.