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@rrsd.com> 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@gmail.com> wrote in message news:6164abb70711100543x284a2592p2189dd14a54d0d54@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.
 


...