Home > Electronics Tutorials > C Language Tutorial > stdio.h - File Functions - freopen

C Language Programming Library Reference Guide

stdio.h - File Functions - freopen

Declaration:

FILE *freopen(const char *filename, const char *mode, FILE *stream); Associates a new filename with the given open stream. The old file in stream is closed. If an error occurs while closing the file, the error is ignored. The mode argument is the same as described in the fopen command. Normally used for reassociating stdin, stdout, or stderr.

On success the pointer to the stream is returned. On error a null pointer is returned.

Note: To report broken links or to submit your projects, tutorials please email to Webmaster

Discover

     more......