编写C++程序“编写程序,将一个文本文件的内容连接到另一个文本文件的末尾。”

2025-05-05 09:21:59
推荐回答(1个)
回答1:

将 in.txt 的内容连接到 out.txt 的末尾
#include
#include
#include
using namespace std;

int main()
{
ifstream ifile;
ifile.open("in.txt");

ofstream ofile;
ofile.open("out.txt",ofstream::app);

string str;
while(ifile>>str)ofile<
ifile.close();
ofile.close();
return 0;
}