27 Dec
2007
27 Dec
'07
7:20 a.m.
Hi all, Code like this: // Save std::ofstream ofs( "c.out" ); A testA1; B testB1; testA1.Save( ofs ); testB1.Save( ofs ); ofs.close(); // Load std::ifstream ifs( "c.out" ); A testA11; B testB11; testA11.Load( ifs ); testB11.Load( ifs ); The testA1 and testB1 can save successful, and the testA11 can load successful, but when loading testB11, it throw a exception "invalid_signature". I have trace into the code, I found when the testA11 loading, the "file_signature" is "serialization::archive", but when testB11 loading, the "file_signature" is empty. Why it like this? What should I do? May be there is the same question before I ask, but I don't know what keyword could be search, sorry. Thanks!