#include#include using namespace std; int main () { cout << "This is sent to prompt" << endl; ofstream file; file.open ("test.txt"); streambuf* sbuf = cout.rdbuf(); cout.rdbuf(file.rdbuf()); cout << "This is sent to file" << endl; cout.rdbuf(sbuf); cout << "This is also sent to prompt" << endl; return 0; }
댓글 없음:
댓글 쓰기