正确答案: C
题目:阅读以下程序及对程序功能的描述,其中正确的描述是#include <stdio.h>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);}
解析:本题主要考查文件的操作。从选项中我们可以知道,本题是对两个磁盘文件进行相关操作。
举一反三的答案和解析: