freopen 重定向至文件后恢复至终端
2018-05-28 13:36:30
操作系统 标准输入输出设备
Windows CON
Linux /dev/tty

Windows

1
2
freopen("CON", "r", stdin);
freopen("CON", "w", stdout);

Linux

1
2
freopen("/dev/tty", "r", stdin);
freopen("/dev/tty", "w", stdout);
Prev
2018-05-28 13:36:30
Next