13- file input/ouput Flashcards
1
Q
stream
A
is a sequence of data to be read (input stream) or a sequence of data generated by the program to be output (output stream)
2
Q
fail()
A
returns true if previous stream operation failed
useful to check if file is opened successfully before performing operations on file
3
Q
exit()
A
exists program immediately.
to use exit, include <cstdlib>
exit() accepts one integer as argument:
convention: 0 - normal program termination; nonzero - abnormal</cstdlib>