
24 Apr
2011
24 Apr
'11
10:22 p.m.
AMDG On 04/24/2011 12:18 PM, Vicente BOTET wrote:
I guess that we can not mix binary and non binary formats. How a binary stream woks for non binary codes?
I don·t know if a manipulator that changes the mode globaly can be defined so the following will work
f << bin << x1 << x2; // write 4+4 bytes f.seekg(0); f >> bin >> y1 >> y2; // read 4+4 bytes
You'd have to replace the num_put facet. Anyway, I don't think a "bin" manipulator is a good idea. If I saw it without already knowing what it meant, I would probably assume that it set the base, like std::dec, std::hex, and std::oct. In Christ, Steven Watanabe