Opens a file and associates a stream with it.
#include <stdio.h> FILE *freopen ( const char *filename, const char *mode, FILE *fp);
(IN) Points to the pathname of the file to be opened.
(IN) Points to a string specifying the file open mode. See Standard File Open Modes.
(IN) Points to the stream.
If successful, returns a pointer to the object controlling the stream. This pointer must be passed as a parameter to subsequent functions for performing operations on the file.
If unsuccessful, freopen returns a NULL pointer and sets errno to one of the following:
The freopen function flushes the stream and any file descriptor associated with the stream. It then closes the stream, opens the file, and associates the specified stream with it.