为什么fstream无法写入文件
相应代码:
bool Student_manager::SaveRecord()
{
for (auto n : *(pmpStudents)) //pmpStudents是map指针,保存信息
{
fsSavedFile << n.first << std::endl; //std::fstream fsSavedFile;
for (auto vt : n.second)
fsSavedFile << vt << std::endl;
}
return true;
}
调用函数后文件还是空的,没有写进任何内容
请问是怎么回事
谢谢各位