C++-读写文件流操作-读写文件操作

综述

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();
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章