#include<iostream>
#include<fstream>
using namespace std;
void main()
{
char c[10000];
ifstream ifile1("C:/a1.txt");
ifstream ifile2("C:/a2.txt");
ofstream ofile("C:/a3.txt");
while (!ifile1.eof())
{
ifile1.getline(c, 9999);
ofile << c << endl;
}
while (!ifile2.eof())
{
ifile2.getline(c, 9999);
ofile << c << endl;
}
ifile1.close();
ifile2.close();
ofile.close();
}
C++简单示例将两个文件合并
最新推荐文章于 2025-06-28 13:41:27 发布