复制文件代码

#include   

int   main()  
{  
char   *sFile="c:\\vbgood.txt";  
char   *dFile="d:\\vbgood.txt";  
char   ch[4];  
FILE   *sfp,*dfp;  

if   ((sfp=fopen(sFile,"rb"))==NULL)  
  return 0;  
if   ((dfp=fopen(dFile,"wb"))==NULL)  
  return 0;  

while(1)  
{  
  if(fread(ch , 4 ,1,sfp )!=1)
   if(!feof(sfp))
    printf("file read error\n");
   else
    break ;
  if(fwrite(ch,4 ,1 ,dfp )!=1)
   printf("file write error\n");
}

fclose(sfp);  
fclose(dfp);  
return(0);  
}
请使用浏览器的分享功能分享到微信等