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
(71)
Correct Answer:
Verified

B

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

Free
(Multiple Choice)
4.9/5
(73)
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
(77)
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
(90)

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
(81)

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
(84)

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

(Multiple Choice)
4.8/5
(81)

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
(89)

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

(Multiple Choice)
4.7/5
(71)

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

(True/False)
4.9/5
(69)

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

(Multiple Choice)
4.9/5
(84)

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

(True/False)
4.8/5
(71)

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

(Multiple Choice)
4.8/5
(72)

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

(Multiple Choice)
5.0/5
(73)

The statement dataFile.close();

(Multiple Choice)
4.7/5
(77)

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

(Multiple Choice)
4.7/5
(87)

ofstream, ifstream, and fstream are

(Multiple Choice)
4.7/5
(75)

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

(Multiple Choice)
4.8/5
(93)

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

(Multiple Choice)
4.8/5
(70)

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

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

Filters

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