第十六周上机实践项目1(3):阅读程序
来源:互联网 发布:微软sql server 编辑:程序博客网 时间:2024/05/10 05:03
/**Copyright(c) 2016.烟台大学计算机与控制工程学院*ALL rights reserved.*文件名称:main.cpp*作者:赵子琳*完成日期:2016年6月20日*问题描述:程序阅读 文件操作*/#include <iostream>#include <fstream>#include<cstring>using namespace std;int main(){ ifstream readFile; ofstream writeFile; char ch[100]={"Hello World!"}; cout<<ch<<endl; readFile.open("a.txt", ios::in); writeFile.open("b.txt", ios::out); while (!readFile.eof()) { readFile.getline(ch,100,'\n'); writeFile.write(ch,strlen(ch)); writeFile.write("\n",1); } cout<<ch<<endl; readFile.close(); writeFile.close(); cout << "Finish!" << endl; return 0;}
0 0
- 第十六周上机实践项目1(3):阅读程序
- 第十六周上机实践项目3(1):阅读程序
- 第十六周上机实践项目3(3):阅读程序
- 第十六周上机实践项目1(1):阅读程序
- 第十六周上机实践项目3(2):阅读程序
- 第十六周上机实践项目1(2):阅读程序
- 第十六周上机实践项目2(1):阅读程序
- 第十六周上机实践项目2(2):阅读程序
- 第十二周上机实践项目-阅读程序-1-(3)
- 第十五周上机实践项目1(3):阅读程序
- 第十六周上机实践阅读程序一
- 第十六周实践项目-阅读程序(3)
- 第十六周实践项目-阅读程序(1)
- 第十六周上机项目阅读程序二
- 第十五周上机实践项目1(1):阅读程序
- 第十五周上机实践项目1(2):阅读程序
- 第十五周上机实践项目1(4):阅读程序
- 第十五周上机实践项目1(5):阅读程序
- int 和 Integer 的区别与作用
- Longest Valid Parentheses 最长的合法括号序列
- Ubuntu caffe安装python/caffe/_caffe.cpp:1:52: fatal error: Python.h: No such file or directory
- Oblivious transfer and Garbled circuits
- SQuirrel 连不上 Phoenix Hbase ---> 可能是因为zookeeper 集群中的一个zookeeper 启动有问题
- 第十六周上机实践项目1(3):阅读程序
- 在vs中建立web项目和web网站的区别
- leetcode--Roman to Integer
- Pig 学习之 日志处理
- 53. Maximum Subarray
- 【leetcode】2. Add Two Numbers
- android中生成随机点
- 第15 章 输入/输出
- 注册表写入读取和启动项删除