版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/OOFFrankDura/article/details/81702683
综述
C++操作文件流的方案很多
这里给出一个我比较喜欢的
代码
读入代码
char*input1 = "/Users/frankdura/Desktop/3D_task/aa.txt";
ifstream readin(input1);
string p;
while (in_boundary >> p){ //读入边界点
cout << p << endl;
}
写入代码
#include <fstream>
ofstream out(filename);
out << "hello world!";
out << end;
out.close();