Question
Write the definition of a function named openLog . This function can be safely passed two arguments, an fstream object and a string object. The function associates the fstream with a file whose name is formed by concatenating the second argument with the suffix ".log". The fstream is made ready for output that is appended to the end of the file. If the file did not exist previously, false is returned; otherwise its content is deleted (truncated) and replaced by a single line:
PREVIOUS CONTENT DELETED
and true is returned.
Solution
If you have a solution, please send via comment
Answers for C++ Course using "Starting out with C++ : from control structures through objects" by Tony Gaddis. 7/8th ed. I used the Pearson myprogramminglab to complete the homework. Here are my solutions/answers for the exercises/labs so please use the test bank as a GUIDE if you're stuck. Let me know if you find a better solution to a problem or any of the programming challenges. Thanks in advance for your support! Send in missing programming challenges to cplusplus.answers@gmail.com
No comments:
Post a Comment