Skip to main content

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*

6
  • But std::ios_base::out also clear the data in the file, no? Can you give me an example where std::ios_base::out don't clear the file? Commented Sep 3, 2012 at 19:47
  • From here : cplusplus.com/reference/iostream/ios_base/openmode you get the definition of each value. Moreover, this answer @veer's comment about std::ios_base::in and std::ios::in Commented Sep 3, 2012 at 19:49
  • And what do you mean by "you can still read from the beginning"? Can you give me an example, please? Commented Sep 3, 2012 at 19:51
  • I mean that ios::ate positions the cursor at the end of the stream, so you can still move it around if you like (and if the stream isn't empty and permit it) Commented Sep 3, 2012 at 19:53
  • Why i can't do this with std::ios_base::app? I can use seekp also Commented Sep 3, 2012 at 19:59