阅读程序
来源:互联网 发布:南风知我意七微txt下载 编辑:程序博客网 时间:2024/04/30 07:58
#include <iostream>
#include <fstream>
include<cstring>
using namespace std;
int main()
{
ifstream readFile;
ofstream writeFile;
char ch[100];
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);
}
readFile.close();
writeFile.close();
cout << "Finish!" << endl;
return 0;
}
#include <iostream>
#include <fstream>
include<cstring>
using namespace std;
int main()
{
ifstream readFile;
ofstream writeFile;
char ch[100];
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);
}
readFile.close();
writeFile.close();
cout << "Finish!" << endl;
return 0;
}
程序功能:
当文件没有达到末尾的时候输入一个字符串,在另一个文件中输出字符串的长度,输出换行符。
- 阅读程序
- 阅读 程序
- 阅读程序
- 阅读程序
- 阅读程序
- 阅读程序
- 阅读程序
- 阅读程序
- 程序阅读
- 阅读程序
- 阅读程序
- 阅读程序
- 阅读程序
- 阅读程序
- 阅读程序
- 阅读程序
- 阅读程序
- 阅读程序
- VELT-0.2.8对STM32开发的支持(1):准备工作
- 遥感(remote sensing)中的植被指数(Vegetation Index)——学习—
- fragment学两个demo就会用(一)
- 微信服务器发送三次重复的排重问题
- Mybaits的第一个程序
- 阅读程序
- Java中collection的总结
- 失传的C结构体打包技艺 -- 内存对齐
- jQuery实现百度导航li拖放排列效果,即时更新数据库
- 我在LeetCode的100题
- 锁屏背景替换-概述
- 入职两个月的一些感受
- 目录的读写执行权限和文件时间戳
- kvc