How to use std::ostream and std::istream binary mode

Started by
1 comment, last by wood_brian 12 years, 2 months ago
I'm trying to write a save/serialization system for my game, and I want to be able to serialize in binary mode. How can I do that? I know how to create binary ifstream and ofstream objects. Is it possible to do the same with regular ostream and istream?
Advertisement
The "binary" flag just means that newlines aren't translated to the platform specific sequence during output. You can use istream::read() and ostream::write() to serialize byte data.

I'm trying to write a save/serialization system for my game, and I want to be able to serialize in binary mode. How can I do that?



The C++ Middleware Writer can help with this and is often more efficient than another approach --
http://webEbenezer.net/comparison.html .


Brian
Ebenezer Enterprises
http://webEbenezer.net

This topic is closed to new replies.

Advertisement