C++ read/write to binary file. on program exit it gives System.AccessViolationException

后端 未结 1 804
广开言路
广开言路 2021-01-27 04:11

This C++ program is created using Visual Studio 2010. It\'s a group project that has everyone in class stumped.
The program initially starts fine and the user can run throu

相关标签:
1条回答
  • 2021-01-27 05:03

    You cannot perform binary I/O this way with an object that contains std::string members. A std::string contains pointer(s) to dynamically allocated memory for its actual contents. You need to perform some type of serialization instead. The usual suggestion is Boost serialization.

    0 讨论(0)
提交回复
热议问题