Write a program to append one file”1.txt” at the end of another “2.txt”.用c编
来源:学生作业帮助网 编辑:作业帮 时间:2024/11/14 20:52:58
Write a program to append one file”1.txt” at the end of another “2.txt”.用c编
Write a program to append one file”1.txt” at the end of another “2.txt”.
用c编
Write a program to append one file”1.txt” at the end of another “2.txt”.用c编
#include
#include
#include
using namespace std;
int openFiles (string inFile1,string inFile2,string outFile1);
void mergeFiles (string inFile1,string inFile2,string outFile1,ifstream& File1,ifstream& File2,ofstream& outFile);
int main()
{
\x05\x05string inFile1,inFile2,outFile1;
\x05\x05ifstream File1;
\x05\x05ifstream File2;
\x05\x05ofstream outFile;
\x05\x05
\x05\x05cout exam1>>examGrade1;
File2 >> File2_fName >> File2_lName>>exam2>>examGrade2;
while (!File1.eof() && \x05!File2.eof())
{
\x05if ((File1_fName>exam1>>examGrade1;\x05
\x05\x05\x05\x05
\x05\x05}
\x05\x05else
\x05\x05{
\x05\x05\x05outFile File2_lName>>exam2>>examGrade2;
\x05\x05}
\x05\x05\x05\x05if (File1.eof() )
\x05\x05\x05\x05{
\x05\x05\x05\x05\x05while (!File2.eof())
\x05\x05\x05\x05\x05{
\x05\x05\x05\x05\x05outFile