用C++写入文件(代码实例)
- 作者: 多遗憾我错过你
- 来源: 51数据库
- 2021-07-07
用c++写入文件(代码实例)
头文件:#include<fstream>
/*打开配置文件*/
ofstream out("input.txt");
if(!out.is_open()){
#if debug
cout<<"打开配置文件失败(写入):"<<endl;
#endif
return -2;
}
/*写入配置文件*/
out <<"写入文件的数据";
out.close();
推荐阅读
