Redirecting standard streams

This section describes redirection of standard streams:

Note that, C++ standard streams are implemented in terms of C standard streams. Therefore, cin, cout, cerr, and clog are implicitly redirected when the corresponding C standard streams are redirected. These streams can be redirected by assignment, as described in Assigning the standard streams. If freopen() is applied to a C standard stream, creating a binary stream or one with type=record or type=blocked, then behavior of the related stream is undefined.