文件名称:sss
介绍说明--下载内容均来自于网络,请自行研究使用
编程序CompFile,首先让用户输入两个文件名及其路径(二文件均为text文件),
而后通过使用类成员函数getline逐行读入这两个指定文件的内容并进行比较。若发现有不同,
则在屏幕上显示出相异二行的行号及其内容,并暂停下来询问用户是否需要继续比较后继行,
直到用户回答不需要继续进行比较,或者已经比到了二文件的结束时停止处理。
思考:也可改写程序,将"让用户输入两个文件名及其路径"改为从命令行参数处获取这两个文件名及其路径。-Programmed CompFile, let the user to enter two file names and path (b files are text files), then by using the class member function getline reads line by line the contents of the two specified files and compared. If there is different, the screen shows two different line number and content, and pause to ask the user whether to continue to compare subsequent rows until the user does not need to compare answers, or have more than two files to the Stop at the end of treatment. Thinking: You can also rewrite the program will " allow the user to enter the file name and path of the two" to obtain these from the command line parameter file name and path.
而后通过使用类成员函数getline逐行读入这两个指定文件的内容并进行比较。若发现有不同,
则在屏幕上显示出相异二行的行号及其内容,并暂停下来询问用户是否需要继续比较后继行,
直到用户回答不需要继续进行比较,或者已经比到了二文件的结束时停止处理。
思考:也可改写程序,将"让用户输入两个文件名及其路径"改为从命令行参数处获取这两个文件名及其路径。-Programmed CompFile, let the user to enter two file names and path (b files are text files), then by using the class member function getline reads line by line the contents of the two specified files and compared. If there is different, the screen shows two different line number and content, and pause to ask the user whether to continue to compare subsequent rows until the user does not need to compare answers, or have more than two files to the Stop at the end of treatment. Thinking: You can also rewrite the program will " allow the user to enter the file name and path of the two" to obtain these from the command line parameter file name and path.
(系统自动生成,下载前可以参看下载内容)
下载文件列表
sss.cpp