To determine whether a file was opened successfully, one can use the ___________ fstream member function

a. close( )
b. overloaded operator <<( )
c. open( )
d. eof( )
e. flush( )


e)
Explanation: e) fail( ) returns a bool value of true if the file is in a failed state, and false if the file state can provide i/o. Part a) 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) is used with a C-string file name (either literal or C-string variable) to open the file and connect the stream to the file name. 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.)

Computer Science & Information Technology

You might also like to view...

__________________ recursion results from the lack of a base case.

a) Indirect b) Direct c) Infinite d) Spiral e) none of the above

Computer Science & Information Technology

You decide to prepare a security checklist for Personal Trainer. Prepare a list of security issues that the firm should evaluate and monitor. Be sure to organize the items into categories that match the six security levels.

What will be an ideal response?

Computer Science & Information Technology

Predesigned files provided within Office are called ________

Fill in the blank(s) with correct word

Computer Science & Information Technology

Choose indices for the following SELECT statement. Specify whether your choices are clustered or unclustered, hash index or B + tree.

``` SELECT C.CrsName, COUNT(*) FROM Course C, Transcript T WHERE T.CrsCode = C.CrsCode AND T.Semester = :sem GROUP BY T.CrsCode, C.CrsName HAVING COUNT(*) ? 100 ```

Computer Science & Information Technology