ifstream 文件读写 文件删除
来源:互联网 发布:c语言自学软件手机版 编辑:程序博客网 时间:2024/05/18 20:12
#include <fstream>#include <string> using namespace std; int main(){ vector<string> vecContent; string strLine; ifstream inFile("e:\\test.txt"); while (inFile) { getline(inFile, strLine); vecContent.push_back(strLine); } inFile.close(); // 删除第一行 vecContent.erase(vecContent.begin()); ofstream outFile("e:\\test.txt"); vector<string>::const_iterator iter = vecContent.begin(); for (; vecContent.end() != iter; ++iter) { outFile.write((*iter).c_str(), (*iter).size()); outFile << '\n'; } outFile.close(); return 0;}
阅读全文
0 0
- ifstream 文件读写 文件删除
- ifstream 读写文件
- ofstream和ifstream 读写文件
- 文件读写 freopen ifstream ofstream
- ifstream ofstream 读写文件异常
- C++文件读写详解(ofstream,ifstream,fstream)
- C++ ofstream ifstream 按行读写文件
- C++ 读写文件方法--fstream,ofstream,ifstream
- fstream ifstream ofstream分块读写文件
- C++文件读写详解(ofstream,ifstream,fstream
- ifstream&&ofstream的.csv文件读写
- C++文件流(ifstream,ofstream,fstream),实现文件读写
- 使用fstream,ifstream,ofstream读写文件的一种情形
- C++文件读写详解(ofstream,ifstream,fstream)
- C++文件读写详解(ofstream,ifstream,fstream)
- C++文件读写详解(ofstream,ifstream,fstream)
- C++文件读写详解(ofstream,ifstream,fstream)
- C++文件读写详解(ofstream,ifstream,fstream)
- linux 安装 weblogic
- zTree使用时expandAll()折叠全部方法和expandNode()同时使用时节点显示问题记录
- 十几行代码搞定Android调用支付宝支付
- git提交代码时遇到代码库有更新以及本地有更新的解决方法
- iOS应用瘦身方法思路整理
- ifstream 文件读写 文件删除
- HTTP响应头和请求头信息对照表
- 今天开始学习泛类堆栈类
- 安卓小项目之Everyday(3)--将笑话数据显示listview中
- HBase之CMS GC调优
- CMenu自绘
- java servlet基本操作 以及将数据库表上传到网页的程序举例
- POI与JXL的区别
- 没有对错,只是轮回