freopen fputc fgetc()

http://baike.baidu.com/link?url=fpZqCK2xX9wd1-1ej1W0zLGxALT6xYeArqEzwNzWRsNQKPtvo3nAt69mpFcFh1gN

#include<stdio.h>
int main()
{
    FILE *f = fopen("C:\\file.dat","r");
    FILE *ff = fopen("C:\\file2.dat","w");
    char ch = fgetc(f);
    while(ch!=EOF)
    {
        printf("%c",ch);
        fputc(ch,ff);
        ch = fgetc(f);
    }
}


 

你可能感兴趣的:(freopen fputc fgetc())