Ato*_*tom 4 c file
我输出到stdout.如何通过代码将其重定向到新文件?当我们运行程序时,我们可以重定向./sample > test.txt.如何在执行示例程序时执行此操作?(C编程)
./sample > test.txt
tva*_*son 7
你可能想用freopen.
参考示例:
#include <stdio.h> ... FILE *fp; ... fp = freopen ("/tmp/logfile", "a+", stdout);
Bas*_*ard 3
使用freopen()。
freopen()
归档时间:
15 年,6 月 前
查看次数:
5534 次
最近记录:
11 年,4 月 前