//head files
#include<iostream>
#include<fstream>
//open or create a txt file
std::ofstream outfile("file.txt");
//write something
outfile << x << std::endl;
//close the file
outfile.close();
C++文件输出
最新推荐文章于 2024-09-27 11:26:03 发布
//head files
#include<iostream>
#include<fstream>
//open or create a txt file
std::ofstream outfile("file.txt");
//write something
outfile << x << std::endl;
//close the file
outfile.close();