#include"Utility.h"
#include"Lk_list_double.h"
#include"String.h"
#include"Editor.h"
void main(int argc, char *argv[]) // count, values of command-line arguments
/*
Pre: Names of input and output files are given as command-line arguments.
Post: Reads an input file that contains lines (character strings),
performs simple editing operations on the lines, and
writes the edited version to the output file.
Uses: methods of class Editor
*/
{
char infName[256],outfName[256];
if (argc < 2) {
cout << "Please input inputfile name(eg. file_in.txt):";
cin >> infName;
}
else strcpy(infName,argv[1]);
ifstream file_in(infName); // Declare and open the input stream.
if (file_in == 0) {
cout << "Can't open input file " << infName << endl;
exit (1);
}
if (argc < 3) {
cout << "Please input outputfile name(eg. file_out.txt):";
cin >> outfName;
}
else strcpy(outfName,argv[2]);
ofstream file_out(outfName); // Declare and open the output stream.
if (file_out == 0) {
cout << "Can't open output file " << outfName << endl;
exit (1);
}
Editor buffer(&file_in, &file_out);
while (buffer.get_command())
buffer.run_command();
}
![avatar](https://profile-avatar.csdnimg.cn/default.jpg!1)
myowndream
- 粉丝: 1
- 资源: 2
最新资源
- 寻找热泵最佳压力的优化算法-Optimization algorithm to find optimal pressure of heat pump-matlab
- 基于重庆大学卓越工程师学院的C++车载软件开发设计源码报告第3篇
- 基于Java的API接口服务平台设计源码
- 基于Vue框架的uniapp小程序设计源码
- 基于Selenium与jieba库的Hadoop-MapReduce新闻词频统计设计源码
- 自主车辆量子群粒子滤波器-Autonomous Vehicle Quantum Swarm Particle Filter-matlab
- 基于Python的STRPsearch:高效检测结构化串联重复序列蛋白的设计源码
- 基于Vue框架的现代化水产溯源系统源码设计
- 基于Java和Vue的在线投稿系统设计源码
- 基于脑风暴优化的交换加密系统设计-Design Swapping Encryption System with Brain Storm Optimization-matlab
- 基于Vue 3框架的BillMaster Vue项目设计源码
- 基于TypeScript实现的自定义全局公共事件订阅系统设计源码
- 基于C语言的TWLW项目学习与设计源码分享
- 基于SSM框架和微信小程序的校园二手数码交易平台系统设计源码
- 基于SSM框架与前端技术的Java小型诊疗预约平台设计源码
- 基于Java语言的Apollo分布式配置中心设计源码
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
![feedback](https://img-home.csdnimg.cn/images/20220527035711.png)
![feedback](https://img-home.csdnimg.cn/images/20220527035711.png)
![feedback-tip](https://img-home.csdnimg.cn/images/20220527035111.png)
- 1
- 2
前往页