- Category:
- Other systems
- Tags:
-
- File Size:
- 10kb
- Update:
- 2018-04-07
- Downloads:
- 0 Times
- Uploaded by:
- xuwenwen
Description: #include <stdio.h>
#include <stdlib.h>
#define MAXLEN 80
int main(void)
{
FILE *fpSrc=NULL;
FILE *fpDst=NULL;
char ch;
char srcFilename[MAXLEN];
char dstFilename[MAXLEN];
printf("Input source filename:");
scanf("%s",srcFilename);
if((fpSrc=fopen(srcFilename,"r"))==NULL)
{
printf("can't open file %s!\n",srcFilename);
exit(0);
}
printf("Input destination filename:");
scanf("%s",srcFilename);
if((fpDst=fopen(dstFilename,"w"))==NULL)
{
printf("can't open file %s!\n",dstFilename);
exit(0);
}
while((ch=fgetc(fpSrc))!=EOF)
{
if(fputc(ch,fpDst)==EOF)
{
printf("Copy failed!");
exit(0);
}
}
printf("Copy succeed.\n");
fclose(fpSrc);
fclose(fpDst);
return 0;
To Search:
File list (Check if you may need any files):
Filename | Size | Date |
---|
1.docx | 13445 | 2018-04-07 |