测试C语言文件输出输入重定向时return上面的system(“pause)失效 解决方法 将标准输入输出流定向回控制台即可
int main(void)
{
int ch;
FILE *file = NULL;
file = freopen("C:\\Users\\a\\Desktop\\111.txt","r",stdin);
while((ch = getchar())!=EOF)
putchar(ch);
freopen("CON","r",stdin);//Linux中CON变更为/dev/tty
system("pause");
return 0;
}