求教freopen的详细解释
能否告诉我 freopen的详细用法。配上一些详细的例子。网上找了N个,都是很简单,只是就事论事的举个小例子,没什么实际意义。感激不尽!
freopen
Syntax:
#include <stdio.h>
FILE *freopen( const char *fname, const char *mode, FILE *stream );
The freopen() function is used to reassign an existing stream to a different file and mode. After a call to this function, the given file stream will refer to fname with access given by mode. The return value of freopen() is the new stream, or NULL if there is an error.