C++ Language/Std/FilesystemAccess/RedirectingStdout

The  function is useful for redirecting   to a file written on the disk.

Additional information about redirecting stdout