1. 程式人生 > >C語言檔案讀寫(輸入輸出重定向)

C語言檔案讀寫(輸入輸出重定向)

 

freopen("D:\\test.txt","r",stdin);//檔案讀入   輸入重定向
freopen("D:\\test.txt","w",stdout);//檔案寫入  輸出重定向

檔案讀入(輸入重定向)

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

檔案寫入(輸出重定向)

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