Exam 12: Advanced File Operations
Exam 1: Introduction to Computers and Programming47 Questions
Exam 2: Introduction to C62 Questions
Exam 3: Expressions and Interactivity45 Questions
Exam 4: Making Decisions51 Questions
Exam 5: Loops and Files60 Questions
Exam 6: Functions49 Questions
Exam 7: Arrays and Vectors56 Questions
Exam 8: Searching and Sorting Arrays30 Questions
Exam 9: Pointers47 Questions
Exam 10: Characters, C-Strings, and More About the String Class47 Questions
Exam 11: Structured Data46 Questions
Exam 12: Advanced File Operations38 Questions
Exam 13: Introduction to Classes54 Questions
Exam 14: More About Classes46 Questions
Exam 15: Inheritance, Polymorphism, and Virtual Functions43 Questions
Exam 16: Exceptions and Templates36 Questions
Exam 17: The Standard Template Library38 Questions
Exam 18: Linked Lists41 Questions
Exam 19: Stacks and Queues47 Questions
Exam 20: Recursion27 Questions
Exam 21: Binary Trees39 Questions
Select questions type
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:
C
The ios::hardfail bit is set when an unrecoverable error occurs.
Free
(True/False)
5.0/5
(44)
Correct Answer:
True
Which of the following means accessing information from a file non-sequentially?
Free
(Multiple Choice)
4.8/5
(28)
Correct Answer:
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)
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)
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
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)