$include_dir="/home/hyper-archives/boost-users/include"; include("$include_dir/msg-header.inc") ?>
Subject: Re: [Boost-users] [serialization] stream error when reading simple treestructure from a binary archive
From: Robert Ramey (ramey_at_[hidden])
Date: 2010-03-13 11:55:18
CurieCat wrote:
> const Node* rootnode = root ;
> Node* newroot = NULL;
> std::ofstream ofs("filename", std::ios::binary);
> {
> boost::archive::binary_oarchive oa(ofs);
> oa << rootnode;
> }
> ofs.close();
> std::ifstream ifs("filename", std::ios::binary);
> {
> boost::archive::binary_iarchive ia(ifs);
> ia >> newroot;
> }
> ifs.close();
> return 0;
> }
try adding std::ios::binary in the right place.
Robert Ramey