cpp文件的反复读取 Posted on 2026-03-29 Edited on 2026-08-03 In Coding 1234567891011121314#include <fstream>using namespace std; int main() { ofstream outfile; outfile.open("1.txt"); outfile << "test1" << endl; outfile.close(); outfile.open("2.txt"); outfile << "test2" << endl; outfile.close();} C++中一个打开文件的流可以多次打开不同的文件