橘子味的心
标题:C库 freopen()

C库 freopen()

#include <stdio.h>



int main () {

   FILE *fp;



   printf("This text is redirected to stdout\n");

   fp = freopen("file.txt", "w+", stdout);



   printf("This text is redirected to file.txt\n");

   fclose(fp);



   return(0);

}

目录

分类