Exam 12: Advanced File Operations

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

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

(True/False)
4.8/5
(37)

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

(True/False)
4.8/5
(43)

If a file already exists, you can open it with the flags ios::in | ios::out to preserve its contents.

(True/False)
4.8/5
(35)

The setprecision manipulator cannot be used to format data written to a file.

(True/False)
4.7/5
(42)

Only one file stream object can be declared per C++ program.

(True/False)
4.8/5
(41)

This state bit is set when an attempted operation has failed.

(Multiple Choice)
4.8/5
(33)

What is true about the following statement? out.open("values.dat", ios::app);

(Multiple Choice)
4.8/5
(42)

This member function can be used to store binary data to a file.

(Multiple Choice)
4.9/5
(38)

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)
5.0/5
(34)

All stream objects have these, which indicate the condition of the stream.

(Multiple Choice)
4.8/5
(43)

This data type can be used to create files, read data from them, and write data to them.

(Multiple Choice)
4.9/5
(45)

Outside of a C++ program, a file is identified by its _________. Inside a C++ program, a file is identified by a ____________.

(Multiple Choice)
4.9/5
(40)

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

(True/False)
4.7/5
(44)

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

(Multiple Choice)
4.9/5
(40)

This state bit can be tested to see if the end of an input stream is encountered.

(Multiple Choice)
4.8/5
(39)

This member function reads a single character from a file.

(Multiple Choice)
4.7/5
(37)

This member function writes a single character to a file.

(Multiple Choice)
4.8/5
(40)

Which statement opens a file and links it to a file stream object?

(Multiple Choice)
4.8/5
(30)
Showing 21 - 38 of 38
close modal

Filters

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