cpp/io/c/freopen

First, attempts to close the file associated with, ignoring any errors. Then, if is not null, attempts to open the file specified by  using  as if by std, and associates that file with the file stream pointed to by. If is a null pointer, then the function attempts to reopen the file that is already associated with  (it is implementation defined which mode changes are allowed in this case).

Return value
on success, a null pointer on failure