c++ 这段代码的含义
bool WriteFishC(FishOil *pOilData){
std::ofstream fileOutput("FishC.txt", std::ios::app);
// std::ios::app用来说明在老数据追加新数据
if (fileOutput.is_open())
{
fileOutput << pOilData->name << " ";
fileOutput << pOilData->uid << " ";
fileOutput << pOilData->sex << "\n";
fileOutput.close();
std::cout << "数据成功保存到FishC.txt\n\n";
}
else
std::cout << "保存失败T_T\n";
return 0; 把 pOilData 的 name、uid、sex 属性的值写到FishC.txt文件中;{:10_256:}
页:
[1]