Exam 12: Advanced File Operations

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

Which of the following is the directive you must use to access files from a C++ program?

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

C

The ios::hardfail bit is set when an unrecoverable error occurs.

Free
(True/False)
5.0/5
(44)
Correct Answer:
Verified

True

Which of the following means accessing information from a file non-sequentially?

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

C

Which of the following is the member function that writes a single character to a file?

(Multiple Choice)
4.9/5
(38)

Which of the following statements opens a file named info.txt for both input and output?

(Multiple Choice)
4.9/5
(39)

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

(Multiple Choice)
4.9/5
(36)

Which of the following is the state bit that is set when an attempted operation fails?

(Multiple Choice)
4.7/5
(38)

In order, the three-step process of using a file in a C++ program involves

(Multiple Choice)
4.9/5
(37)

Closing a file causes any unsaved information still held in the file buffer to be

(Multiple Choice)
4.7/5
(43)

To set up a file to perform I/O you must declare

(Multiple Choice)
4.8/5
(29)

Which of the following is the member function that can be used to store binary data to a file?

(Multiple Choice)
4.9/5
(35)

When data is read from a file, it is automatically stored in a variable.

(True/False)
4.8/5
(35)

Data stored __________ disappears once the program stops running or the computer is powered down.

(Multiple Choice)
4.8/5
(20)

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

(True/False)
4.8/5
(37)

Which of the following is the member function that reads a single character from a file?

(Multiple Choice)
4.8/5
(26)

Which of the following is the data type that can be used to create files, read data from them, and write data to them?

(Multiple Choice)
4.8/5
(33)

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

(Multiple Choice)
4.8/5
(30)

By default, files are opened in binary mode.

(True/False)
4.8/5
(37)

When used by itself, the ios::app flag causes the file's existing contents to be deleted if the file already exists.

(True/False)
4.9/5
(43)

When passing a file stream object to a function, you should always pass it by reference.

(True/False)
4.9/5
(50)
Showing 1 - 20 of 38
close modal

Filters

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