ios question

Hi, can I know how to use this actually? And what are them? Thanks :)


Hi there,

This page:
Ass does this:

Describe those.

Hope that helps.
All the best,

Last edited on
Hi thanks, actually I have read those...but don't understand what it means by this

Open in binary mode.

I need example to see the result, then only can understand that :)

Sorry, I'm just a beginner myself, but I did come up with this:

Maybe someone with more experience would be kind enough to give a better explanation than myself.

All the best,
Last edited on
closed account (zb0S216C)
ios::binary opens the file in binary mode. In binary mode, special characters, such as newline & carriage return, are read as they are; they are not translated into escape sequences. Basically, what you read is what you get, not magic.

ios::ate sets the initial reading position to the end of the file.
ios::trunc removes everything from the file before writing in the new data. Based on the behaviour of std::ofstream, this flag is initially set.

ios::app adds any new data to the end of the file. The old data remains unmodified.

Last edited on
Topic archived. No new replies allowed.