Exam 13: Advanced File and Io Operations

arrow
  • Select Tags
search iconSearch Question
flashcardsStudy Flashcards
  • Select Tags

When a file is opened for reading, the file stream object's "read position" is

Free
(Multiple Choice)
4.8/5
(33)
Correct Answer:
Verified

B

The operating system records the information that tracks the end of the file

Free
(Multiple Choice)
4.8/5
(28)
Correct Answer:
Verified

C

When used by itself, ________ causes a file's contents to be deleted if the file already exists.

Free
(Multiple Choice)
4.9/5
(44)
Correct Answer:
Verified

C

The stream member function fail() can be used to determine whether the last operation performed on a stream was successful.

(True/False)
4.8/5
(41)

An alternative to using the open member function is to use the file stream object declaration itself to open the file. Example: fstream dataFile("names.dat",ios::in|ios::out);

(True/False)
4.8/5
(30)

Opening a file with the flags ios::in | ios::out will preserve the contents of the file if the file already exists.

(True/False)
4.9/5
(35)

The ________ member function reports when the end of a file has been found.

(Multiple Choice)
4.8/5
(37)

Outside of a C++ program, a file is identified by its ________. Inside a C++ program, a file is accessed through a ________.

(Multiple Choice)
4.9/5
(40)

A file must be ________ before data can be written to or read from it.

(Multiple Choice)
4.7/5
(32)

File output may be formatted the same way as screen output.

(True/False)
4.9/5
(31)

The ________ may be used to read information from a file.

(Multiple Choice)
4.8/5
(37)

string objects cannot be stored to a binary file without further processing because they contain pointers.

(True/False)
4.8/5
(36)

Which statement opens a file in such a way that information will only be written to its end?

(Multiple Choice)
4.8/5
(36)

The state bit, ________, can be tested to see if the end of an input stream has been encountered.

(Multiple Choice)
4.9/5
(37)

The statement dataFile.close();

(Multiple Choice)
4.7/5
(38)

All stream objects have ________ that indicate the condition of the stream.

(Multiple Choice)
4.7/5
(35)

ofstream, ifstream, and fstream are

(Multiple Choice)
4.7/5
(33)

The member function ________ writes a single character to a file.

(Multiple Choice)
4.8/5
(36)

To access files from a C++ program, you must #include

(Multiple Choice)
4.8/5
(37)

The state bit ________ is set when an attempted operation has failed.

(Multiple Choice)
4.8/5
(28)
Showing 1 - 20 of 40
close modal

Filters

  • Essay(0)
  • Multiple Choice(0)
  • Short Answer(0)
  • True False(0)
  • Matching(0)