רגע, אם את משתמשת ב-freopen,
#include <stdio.h> int main() { FILE *fout1; FILE *fout2; fout1 = freopen("c:\\screen.txt", "wt", stdout); printf("Hello, world! (will be sent to the file)\n"); fclose(stdout); fout2 = freopen("con", "wt", stdout); printf("Hello, world! (will be sent to the screen)\n"); return 0; }