void WriteToFile(string content)
{
fstream outFile("D:\\TestLog.txt", std::ios::app);
outFile << content+"\n";
cout << "写入成功";
outFile.close();
}
c++写入字符串到txt文件
于 2023-02-27 11:17:35 首次发布
void WriteToFile(string content)
{
fstream outFile("D:\\TestLog.txt", std::ios::app);
outFile << content+"\n";
cout << "写入成功";
outFile.close();
}