第16周-阅读程序(3)
来源:互联网 发布:淘宝宝贝更换类目 编辑:程序博客网 时间:2024/05/19 17:05
#include <iostream>#include<fstream>using namespace std;int main(){ fstream outfile,infile; outfile.open("data.txt",ios::out); for(int i=0;i<26;i++) outfile<<(char)('A'+i); outfile.close(); infile.open("data.txt",ios::in); char ch; infile.seekg(6,ios::beg); if(infile.get(ch)) cout<<ch; infile.seekg(8,ios::beg); if(infile.get(ch)) cout<<ch; infile.seekg(-8,ios::end); if(infile.get(ch)) cout<<ch; cout<<endl; infile.close(); return 0;}
运行结果:
0 0
- 第16周阅读程序(3)
- 第16周-阅读程序(3)
- 第16周程序阅读(3)
- 第16周程序阅读(3)
- 第16周阅读程序3
- 第16周-阅读程序3
- 第16周 阅读程序 3
- 第16周-阅读程序(1)
- 第16周-阅读程序(2)
- 第16周阅读程序(1)
- 第16周阅读程序(2)
- 第16周 阅读程序 (1)
- 第16周程序阅读(1)
- 第16周 程序阅读(2)
- 第16周 阅读程序 ( 2)
- 第16周 程序阅读(4)
- 第16周程序阅读(5)
- 第16周程序阅读(6)
- 对于单链表的基本操作
- 小偷问题
- Google Protocol Buffer 的使用和原理
- android:ellipsize的使用
- 第十四周上机实践项目1(1):排序函数模板(冒泡法排序)
- 第16周-阅读程序(3)
- C/C++ struct/class/union内存对齐
- Angularjs理解二
- C# ?、?? 问号和2个问号的用法
- Android sdk的基础编译命令
- css定位和浮动
- Android 绘制圆形进度条
- coffeescript使用的方式汇总
- 《快学Scala》, <Scala For the Impatient>习题第二章