Skip to main content
AI Assist is now on Stack Overflow. Start a chat to get instant answers from across the network. Sign up to save and share your chats.

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

4
  • If you’re using C++, please use the C++ tag. Commented Oct 14, 2018 at 14:38
  • 1
    If you don’t want the output appended, don’t use the append flag. But I think you’ll find that you do want to append messages. It is easier to see what was going on after the event if you have all the logged messages. Commented Oct 14, 2018 at 14:41
  • You don't need file.close(), the stream closes itself when going out of scope. Commented Oct 14, 2018 at 14:43
  • @skalet True, but closing the file manually is the only way to check for errors of the close operation. Commented Oct 14, 2018 at 16:58