C++写txt文件

C++写txt文件

#include<iostream>
int main()
{
...
	ofstream dataFile;		
	dataFile.open("D:\\...\\***.txt", ios::app);
    if (!dataFile.is_open())
    {
        cout << "文件打开失败" << endl;
        return 0;
    }
    dataFile << fixed << setprecision(3) << x0 << "," << y0 << "," << z0 << ",";
    dataFile << 0.0 << "," << 0.0 << "," << 0.0 << "," << 0.0 << "," << 0.0 << "," << 0.0 << endl;
     dataFile.close();
     
...
}

已标记关键词 清除标记
©️2020 CSDN 皮肤主题: 数字20 设计师:CSDN官方博客 返回首页