Sam Contapay wrote:
Now here is my save and load
save: // Save the bayes filter especially the map for later use std::ofstream ofs("BayesFilter.stb"); boost::archive::text_oarchive outarchive(ofs); outarchive << this; ofs.close();
load:
std::ifstream ifs("BayesFilter.stb"); boost::archive::text_iarchive ia(ifs); CObjTest test; ia >> test; ifs.close();
There is a aproblem here. You're saving a pointer (this) and loading and object. You should have something like: // Save the bayes filter especially the map for later use CObjTest test; .... std::ofstream ofs("BayesFilter.stb"); boost::archive::text_oarchive outarchive(ofs); outarchive << test;
load:
std::ifstream ifs("BayesFilter.stb"); boost::archive::text_iarchive ia(ifs); CObjTest test; ia >> test; That should do it. Robert Ramey