C++文件流操作(耦合)
来源:互联网 发布:如何关闭qq游戏端口 编辑:程序博客网 时间:2024/04/30 14:01
// file-stream-coupling.cpp : 定义控制台应用程序的入口点。
//
#include "stdafx.h"
#include <iostream>
#include <fstream>
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
//open file "example.dat" for reading and writing
filebuf buffer;
ostream output(&buffer);
istream input(&buffer);
buffer.open("example.dat", ios::in|ios::out|ios::trunc);
for(int i=1;i<=4;i++){
//write one line
output<<i<<".line"<<endl;
//print all file contents
input.seekg(0);
char c;
while(input.get(c)){
cout.put(c);
}
cout<<endl;
input.clear();//clear eofbit and failbit
}
system("pause");
return 0;
}
- C++文件流操作(耦合)
- 【C/C++】文件流操作
- C流式文件操作
- Objective-C文件流操作
- C#IO流文件操作
- [C/C++]文件操作
- 文件操作--C 函数操作
- C基于流fstream的文件操作
- C/C++流操作(文件,字符串)
- 文件的流操作(C)
- C基于流fstream的文件操作
- C语言文件流操作函数大全
- 基本文件流操作(C语言)
- c文件操作
- C文件操作
- C的文件操作
- c语言文件操作
- C的文件操作
- 数据库连接字符串大全 之 SQL服务器篇
- about the storageof variables (arm7 platform)
- 数据结构——关于KMP算法的效率分析
- SQL Server中, DateTime (日期)型操作的 SQL语法(转载)
- extjs 根据不同的操作动态替换panel上的tbar
- C++文件流操作(耦合)
- 打造极速MyEclipse
- .net按格式导出到.txt文件
- wave音频数据的格式
- 声音的播放——MCI的使用
- 記号の読み方
- 关于ADO+SQL /Access里面查询日期时间类型语句的一点总结
- p2p开源项目
- 详细介绍五种JSP跳转方法