Ignorance at best.
I also have a definition for simply writing data to a file without regard for endianness or other portability issues: it's called "stupidity."
That is an incredibly stupid definition... the ultimate in stupid definitions. If you dump a "little endian" integer of four bytes it follows an expected byte pattern by definition.
By my definition of binary file, that is not a binary file because it follows a certain expected byte pattern.
And that is what I have been trying to say: binary files (my definition) aren't portable.
ENOUGH OF THIS! You are either foolish or a liar
Which is why I wanted to discourage the write function, which phantomotap complained about.
It does not matter what definition of "binary file" you use, you can not use "text mode" of the C or C++ standard library IO facilities to create examples of either kind because these facilities are allowed to translate the binary patterns sent to them.
To make the above clearer, you are wrong no matter the definition you choose to use.
So, which is it?