c++ 读入和写入文件

读入

#include<ifstream>

ifstream infile;
infile.open(img_dir);
while(getline(infile,tmp)){

}

写入

#include <fstream>

ofstream outfile;
outfile.open(txt_dir)
outfile<<123<<endl;
outfile.close();

 

posted @ 2018-05-23 16:25  有梦就要去实现他  阅读(219)  评论(0编辑  收藏  举报