1第12章作业上机题新教材p2591,4,5,6(老教材p3044,7,8,9)1
语句:#includeprintf("%d%d%d",NULL,'\0',EOF);将输出_______
A.001B.00-1C.NULL\0EOFD
10EOF3
若文件型指针fp中指向某文件的末尾,则函数feof(fp)的返回值是__________
以读写方式打开一个已有的文本文件file1,并且FILE*fp,下面fopen函数正确的调用方式是________
fp=fopen("file1","r")B
fp=fopen("file1","r+")C
fp=fopen("file1","rb")D
fp=fopen("file1","w")24
假设文本文件a
txt中存放了下列数据:one
output
txt中存放了下列数据:one
output
下列程序的输出结果是_________________
#include#includevoidmain(){intcount;charch1,ch2;FILE*f1,*f2;If((f1=fopen(“a
txt”,”r”))==NULL){Printf(“Can’topenfile:%s\n”,”a
txt”);Exit(0);}If((f2=fopen(“b
txt”,”r”))==NULL){Printf(“Can’topenfile:%s\n”,”b
txt”);Exit(0);}count=0;while(
feof(f1)||
foef(f2)){ch1=fgetc(f1);ch2=fgetc(f2);if(ch1
=ch2){printf(“%c#%c#”,ch1,ch2);printf(“%d#”,count);break;