Chapter 12: Problem 54
True or False A file may be opened in the definition of the file stream object.
Chapter 12: Problem 54
True or False A file may be opened in the definition of the file stream object.
All the tools & learning materials you need for study success - in one app.
Get started for freeIf a program has read to the end of a file, what must you do before using either the seekg or seekp member functions?
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.
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 __ member function returns a file's current read position.
Write code that opens the file data.txt for both input and output, but first determines if the file exists. If the file does not exist, the code should create it, then open it for both input and output.
What do you think about this solution?
We value your feedback to improve our textbook solutions.