引发异常:读取访问冲突。帮助请

labratory th;
ifstream file_th("labs.txt", ios::in);
while (!file_th.eof()) {
    file_th.read((char*)&th, sizeof(th));
    this->labName = th.getname();
    this->labgroupname = th.getgroup();
    this->masoul = th.getmasoul();
    cout << "Name:" << labName << endl << "scientific group:" << labgroupname << endl << "resposible" << masoul << endl;
}
file_th.close();

它是我的代码在课堂上这样做的问题是什么

评论