
13 Mar
2010
13 Mar
'10
4:55 p.m.
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