阅读以下程序及对程序功能的描述,其中正确的描述是( )。
#include <stdio.h>
int main( )
{ FILE *in, *out;
char ch, infile[10], outfile[10];
printf("Enter the infile name:\n");
scanf("%s", infile);
printf("Enter the outfile name:\n");
scanf("%s", outfile);
if ((in = fopen(infile, "r")) == NULL)
{ printf("Cannot open infile!\n");
return 0;
}
if ((out = fopen(outfile, "w"))== NULL)
{ printf("Cannot open outfile!\n");
return 0;
}
while (!feof(in)) fputc(fgetc(in), out);
fclose(in);
fclose(out);
}
A)程序的功能是:将磁盘文件的信息在屏幕上显示
B)程序的功能是:将两个磁盘文件合二为一
C)程序的功能是:将一个磁盘文件复制到另一个磁盘文件
D)程序的功能是:将两个磁盘文件合并,且在屏幕上输出
A
B
C
D
正确率:
C