题目内容

阅读以下程序及对程序功能的描述,其中正确的描述是()。#includeint main(){ FILE *in,*out; char c,infile[10],outfile[10]; printf("Enter the infilename:\n"); scanf("%s",infile); printf("Enternet theoutfile 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((c=fgetc(in))!=EOF) fputc(c,out); fclose(in);fclose(out); }

A. 程序完成将两个磁盘文件合二为一的功能
B. 程序完成将磁盘文件的信息在屏幕上显示的功能
C. 程序完成将一个磁盘文件复制到另一个磁盘文件中的功能
D. 程序完成将两个磁盘文件合并且在屏幕上输出的功能

查看答案
更多问题

下面程序的输出是()。 int main(){ enum team{my,your=4,his,her=his+10}; printf("%d %d %d %d\n",my,your,his,her); return 0; }

A. 0 1 2 3
B. 0 4 0 10
C. 0 4 5 15
D. l 4 5 15

若有以下定义和语句: struct student{int num ;int age;};struct student stu[3]={{l001,20},{1002,19},{1003,2l}};int main(){ struct student *p;p=stu; ... } 则下列引用中不正确的是()。

A. (p++)→num
B. p++
C. (*p).num
D. p=&stu.age

下面程序的运行结果是()。 int main() { struct cmplx{ int x;int y; }cnum[2]={1,3,2,7}; printf("%d\n",cnum[0].x/cnum[0].y*cnum[1].x); }

A. 0
B. 1
C. 3
D. 6

下面程序的输出是()。 typedef union{long x[2]; int y[4]; char z[8]; } MYTYPE;MYTYPE them;int main(){printf("%d\n",sizeof(them)); }

A. 32
B. 16
C. 8
D. 24

答案查题题库