#include #include//文件操作 #include using namespace std; void test1() { //创建流对象 ofstream ofs; //指定的打开放式 ofs.open("test.txt", ios::out); //写入内容 ofs << "姓名:张三" << endl; //关闭文件 ofs.close(); } int main() { test1(); system("pause"); return 0; }
上一篇 C++20新特性的小细节
下一篇 爆肝IT小白的关键字狂想曲
版权所有 ©2023-2025 051e.com
ICP备案号:京ICP备12030808号