Mega Code Archive

 
Categories / C / File
 

Reopen a stream with a different file and mode

#include <stdio.h> int main () {   freopen ("my.txt","w",stdout);   printf ("This line is redirected to a file.");   fclose (stdout);   return 0; }