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