C++文件写
#include <iostream>
#include <fstream>
int main()
{
using namespace std;
ofstream ofs;
ofs.open("test.txt", ios::out);
ofs << "hello furong" << endl;
ofs << "i love y" << endl;
ofs.close();
return 0;
}
$ ./a.out
$ cat test.txt
hello furong
i love y