C语言文件读写(输入输出重定向)

版权声明:原创文章如需转载请注明出处 https://blog.csdn.net/holly_Z_P_F/article/details/85196075
freopen("D:\\test.txt","r",stdin);//文件读入   输入重定向
freopen("D:\\test.txt","w",stdout);//文件写入  输出重定向

文件读入(输入重定向)

freopen ( " D:\\test.txt " , "r" , stdin );

文件写入(输出重定向)

freopen ( " D:\\test.txt " , "w", stdout ) ;

猜你喜欢

转载自blog.csdn.net/holly_Z_P_F/article/details/85196075