我想在这里分享两点。
struct employee * employeePtr = static_cast< struct employee *>(temp);
cout<< employeePtr - > number;
...
当您尝试的对象时,您反序列化的方式是可以的 serialize占用连续内存。如果不是这种情况,您将不得不以其他方式处理它们(例如使用流)。此类案件的例子包括:
当你有指针,shared_ptr等到一些分配的内存
容器类