Chapter 12: Problem 16
How do you determine the number of bytes that a file contains?
Chapter 12: Problem 16
How do you determine the number of bytes that a file contains?
All the tools & learning materials you need for study success - in one app.
Get started for freeEach of the following programs or program segments has errors. Find as many as you can. fstream file(ios:: in | ios: :out) ; file.open ("info.dat") ; if ( ! file) cout \(<<\) "Could not open file. \(\backslash n^{\prime \prime}\)
Write two statements that use a file stream object named places to open a file named places.dat. (Show how to open the file with a member function and at the definition of the file stream object.) The file should be opened for both input and output.
The ___ mode flag causes an offset to be calculated from the beginning of a file.
Write two statements that use a file stream object named people to open a file named people. dat. (Show how to open the file with a member function and at the definition of the file stream object.) The file should be opened for output.
In __ file access, the contents of the file are read in the order they appear in the file, from the file's start to its end.
What do you think about this solution?
We value your feedback to improve our textbook solutions.