C库 freopen() C库函数 fread() C库函数 remove() 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); } C库函数 fread() C库函数 remove()