iostream.h
fstream.h
.
This contains the classes ofstream
and
ifstream
.
Instance.open(FileName)
renews
the file if possible.
Instance.close()
is good programming.
<<
Instance.fail()
determines if the operation has
failed.
assert
provides less control.
Instance.open(FileName)
opens
the file if possible.
Instance.close()
is good programming.
>>
Instance.eof()
is
common, especially when looping through input. (p.342).
Read first item of data While not end of stream do Process the data Read next item of data
InputStreamInstance.getline(String,MaxLength)
reads a whole line at once (or less if the line is too long).
InputStreamInstance.get(CharacterVariable)
, and
single characters can be output with
OutputStreamInstance.put(CharacterVariable)
.
Instance.write(&Variable,Size)
and
Instance.read(&Variable,Size)