c++写入txt

用ofstream 输出流,
#include <fstream>

ofstream outf; 
outf.open("abc.txt");
outf<<123<<endl;
outf.close();

原文地址:https://www.cnblogs.com/xzh1993/p/7677304.html