C++中将输出指定到文件的方法:
第一种:
FILE* file = fopen(“C:\test.txt”,”w+” );
fstream cout(file);
cout<<需要输出的内容;
fclose(file);
第二种:
FILE* file = freopen(“C:\test.txt”, “w+”,stdout );
cout<<需要输出的内容;
fclose(file);
C++中将输出指定到文件的方法:
最新推荐文章于 2024-05-03 17:15:52 发布