摘要: 遇上文本处理的话,基本上都是先读取文件,再逐行读取文本,再进行文本分割。1、读取文本使用头文件#include ,包含ifstream-输入流,ofstream-输出流,iostream-输入输出流三种类型的文件流。ifstream iFile;int a;iFile.open(filename);//ifstream默认以读方式打开//do your jobiFile>>a;iFile.close();2、逐行读取char buf[300000];while (!iFile.eof()){// find the end of the file iFile.getline(buf, 阅读全文
posted @ 2013-04-10 10:03 iyjhabc 阅读(4872) 评论(0) 推荐(0) 编辑