How to redirect the output back to the screen after freopen(“out.txt”, “a”, stdout)

I can’t think of a way to do this in a cross-platform manner, but on GNU/Linux systems (and maybe other POSIX-compliant ones, too) you can freopen ("/dev/tty", "a", stdout). Is this what you were trying to do?

Leave a Comment