Boost logo

Boost Users :

From: Mahesh Venkitachalam (mkvenkit.vc_at_[hidden])
Date: 2007-11-10 22:01:37


Yes, that was it - thanks very much for looking at it. I was using a text
archive before, and everything was working even after I switched to binary,
till I started using strings. I missed out on adding ios::binary to the
write...

Best Regards

Mahesh

On Nov 10, 2007 10:03 PM, Robert Ramey <ramey_at_[hidden]> wrote:

> try replacing
> std::ofstream ofs("test.bin");
> with
> std::ofstream ofs("test.bin", ios::binary);
> does that help?
>
> Robert Ramey
>
> "Mahesh Venkitachalam" <mkvenkit.vc_at_[hidden]> wrote in message
> news:6164abb70711100543x284a2592p2189dd14a54d0d54_at_mail.gmail.com...
> Hello,
>
> I am having a strange problem with std::string as I am trying to read
> from a binary archive using Boost serialization. I am new to this, and
> it is possible that I have not understood the usage. In the code
> below, the string "faultblock" seems to be causing the problem. The
> code crashes in the ia & tst line which is reading back the archive -
> the stack indicates that it is trying to read an invalid string.
>
>
...



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net