c++读写
来源:互联网 发布:java防止xss攻击代码 编辑:程序博客网 时间:2024/06/05 18:32
这是大神们的总结
fstream类
#include <iostream.h>#include <fstream>using namespace std;int main(){<span style="white-space:pre"></span>ifstream in("myfile.txt");<span style="white-space:pre"></span>ofstream out("myfile1.txt");<span style="white-space:pre"></span>if(!in||!out)<span style="white-space:pre"></span>{<span style="white-space:pre"></span>return -1;<span style="white-space:pre"></span>}<span style="white-space:pre"></span>char buf[1000];<span style="white-space:pre"></span>while(!in.eof())<span style="white-space:pre"></span>{<span style="white-space:pre"></span>in.getline(buf,sizeof(buf));<span style="white-space:pre"></span>out<<buf;<span style="white-space:pre"></span>in.read(buf,sizeof(buf));<span style="white-space:pre"></span>out.write(buf,in.gcount());<span style="white-space:pre"></span>}<span style="white-space:pre"></span>in.close();<span style="white-space:pre"></span>out.close();<span style="white-space:pre"></span>return 0;}
0 0
- 【C/C++】文件读写
- c语言读写文件
- c中文件读写
- C语言读写配置文件
- 文件读写(c)
- 读写文本文件(C#)
- C#-读写INI文件
- C#读写Excel.
- [C++]文件读写操作
- C#,数据库读写XML
- C#,数据库读写XML
- C#读写INI文件
- C 读写文件
- C语言读写
- C读写ini文件
- c#FileStream文件读写
- 读写文件 c
- c语言读写配置文件
- 设计模式之--Factory模式
- Activity的生命周期(一)
- 关于Spring MVC Interceptor的设置顺序
- zoj 3327 Friend Number(有难度的模拟题)
- Spring之Construcotrer注入和setter注入不同的XML写法方式
- c++读写
- Activity intent经常使用的 FLAG 集合
- ACID
- 代码实现安装、卸载、分享软件
- 如何让listView加入的HeaderView不可点击(转)
- 莫垮
- android编程常见模块
- Android第三方类库:slidingmenu 实现侧滑菜单
- 【Android基础】EditText键盘搜索事件设置和监听