綜述
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();