填空题
下列程序的主要功能是()。
#include
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”);
exit(0);
}
if((out=fopen(outfile, “w”))==NULL){
printf(“Cannot open outfile\n”);
exit(0);
}
while(!feof(in))
fputc(fgetc(in),out);
fclose(in);
fclose(out);
}
【参考答案】
将一个磁盘文件复制到另一个磁盘文件中
点击查看答案
相关考题
-
填空题
若下列程序中的函数scmp功能是返回形参指针s1和s2所指字符串中较小字符串的首地址,并且运行程序时依次输入abcd、abba和abc三个字符串,则该程序的输出结果是() -
填空题
下列程序的功能是将从键盘输入的一对整数由小到大排序输出,当输入的一对整数相等时结束循环。程序中的空白处(横线上方)应该填入()。 #include main( ) { int a,b,temp; scanf(“%d%d”,&a,&b); while( ){ if(a>b){ temp=a; a=b; b=temp; } printf(“%d,%d\n”,a,b); scanf(“%d%d”,&a,&b); } } -
填空题
若有定义:“intx[10],*p,p=x;”,则在程序中引用数组元素x[i]的四种形式中,除了x[i]、p[i]和*(p+i)以外,还有()
