To open a file for read-write and random access requires
a. The usual definition of an ofstream or ifstream object.
b. A call to open ofstream or ifstream object, but there must be a second argument to the open function.
c. The stream to be defined using the class fstream. defined in the
d. The stream to be connected to the physical file object with first argument a C-string containing the physical file name and a second argument, ios::in | ios::out that specifies that the i/o with the file should be for either reading or writing.
e. #include
A complete answer requires c) d) and e)
Explanation: a) only defines an output stream or an input stream, respectively. b) is in error because the stream should be fstream and because the answer fails to specify the second argument for open().
You might also like to view...
The Themes group is located on the ________ tab
A) Edit B) Format C) Insert D) Design
The number of bits in a bit field is specified with:
a. Parentheses as in bitfield( 4 ) b. A colon as in bitfield : 4 c. Brackets as in bitfield[ 4 ] d. A dot as in bitfield.4