#include <fstream>
ofstream fout;
fout.open(“filename”);
//文件打开是否失败
if(fout.fail())
exit(1);
fout<<” ";
#include <fstream>
ofstream fout;
fout.open(“filename”);
//文件打开是否失败
if(fout.fail())
exit(1);
fout<<” ";
转载于:https://www.cnblogs.com/zxs2011/archive/2011/12/20/2295144.html