The ____________ fstream member function closes a file stream. Explain why it is best to close a file when the program is through processing the data in the file.
a) close( )
b) overloaded operator <<( )
c) open( )
d) eof( )
e) flush( )
a) close( )
Part a) close() is used without argument to close the file to prevent file corruption, a possibility if the program terminates abnormally. Part b) has nothing to do with opening a file. Part c) opens a file stream and connects it to a physical file. The argument is a C-string constant or variable. Part d) returns a type bool value of true if the file pointer has attempted to read at end of file. (To read beyond end of file is an error.) Part e) flush( ) is used without argument to write the file buffer out to the physical medium.
You might also like to view...
Java supports ________; collections of related methods that typically enable you to tell objects what to do, but not how to do it (we’ll see an exception to this in Java SE 8).
a. classes b. subclasses c. superclasses d. interfaces
To modify the number of items displayed in a combo box list, you use the ____ property.
A. Control Source B. List Rows C. Limit to List D. Drop-Down
Answer the following statement(s) true (T) or false (F)
To help determine which computer forensics tool to purchase, a comparison table of functions, subfunctions, and vendor products is useful.
A(n) ________, which is a special application that collects and reports certain types of data, can help managers make better decisions.
A. TPS B. MIS C. office automation system D. DSS