将数据写入txt c++

以append 方式将数据写入txt:

ofstream f;

f.open("D:\\1.txt", ios::app);
f << "1" << endl;
f.close();

猜你喜欢

转载自blog.csdn.net/ywj541726330/article/details/80928327