#include<iostream>
#include<string>
#include<fstream>//文件流工具类头文件
using namespace std;
void test() {
//1,包含头文件fstream
//2,创建文件流对象
ofstream ofs;
//3,打开文件流对象
ofs.open("textWXD.txt", ios::out);
//4,写数据 “<<”
ofs << "Wang Xiaodong" << endl;
ofs << "王晓东" << endl;
//5,关闭文件流对像
ofs.close();
}
int main() {
test();
}
04-02
4113
07-14
3834