Bien vu !!
The freopen function
Synopsis
1 #include <stdio.h>
FILE *freopen(const char * filename,
const char * mode,
FILE * restrict stream);
Description
2 The freopen function opens the file whose name is the string pointed to by filename
and associates the stream pointed to by stream with it. The mode argument is used just
as in the fopen function.215)
3 Iffilename is a null pointer, the freopen function attempts to change the mode of
the stream to that specified by mode, as if the name of the file currently associated with
the stream had been used. It is implementation-defined which changes of mode are
permitted (if any), and under what circumstances.
4 The freopen function first attempts to close any file that is associated with the specified
stream. Failure to close the file is ignored. The error and end-of-file indicators for the
stream are cleared.
Returns
5 The freopen function returns a null pointer if the open operation fails. Otherwise,
freopen returns the value of stream.
215) The primary use of the freopen function is to change the file associated with a standard text stream
(stderr, stdin, or stdout), as those identifiers need not be modifiable lvalues to which the value
returned by the fopen function may be assigned.
(extrait de la page 276)
d'après la note de bas de page freopen() sers à faire ça : réorienté les flux.
Salutation ! avant je croyais, maintenant je suis fixé.Jésus Christ
Char Snipeur