freopen [C++ Reference]
Keywords: c,io,freopen
Date: 2008-10-14T15:42:01-0700

[[freopen]]
C++ Reference
Translations of this page?:

- en
- br-pt
- cn
- fr
- it
- jp
- pl
- ru
- tr

## freopen

Syntax:

        #include <cstdio>
        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.

The mode argument shall be used just as in fopen.

Related Topics: fclose, fopen

Edit this page • Old revisions
• • • Login • Index • Recent changes • RSS • cc •