Slide 2.6: Reading and displaying file contents (cont.) Slide 2.8: Seeking (cont.) Home |
fstream
has two file pointers:
get
pointer for input, which determines the next location to be read in the buffer associated to the input stream.
put
pointer for output, which determines the next location where to write in the buffer associated to the output stream.
test.txt
, whose contents are
<br>This is only a test.<br>
<br>
tags, whose offsets are 0 and 24, respectively.
<h1>
and </h1>
, respectively.