#include <iostream>
#include <fstream>
using namespace std;
ofstream file( "rdbuf.txt" );
streambuf *x = cout.rdbuf( file.rdbuf( ) );
cout << "test" << endl;
cout << "test2" << endl;
cout.rdbuf(x);C++ 文件写入
最新推荐文章于 2024-07-30 22:17:41 发布
#include <iostream>
#include <fstream>
using namespace std;
ofstream file( "rdbuf.txt" );
streambuf *x = cout.rdbuf( file.rdbuf( ) );
cout << "test" << endl;
cout << "test2" << endl;
cout.rdbuf(x);
564
3319

被折叠的 条评论
为什么被折叠?