#include〈stdio.h〉
main()
{FILE *fp1;
fp1=fopen("f1.txt","w");
fprintf(fp1,"abc");
fclose(fp1);
}
若文本文件f1.txt中原有内容为:good,则运行以上程序后文件f1.txt中的内容为
A.goodabc
B.abcd
C.abc
D.abcgood
[单选题]有如下程序#include <stdio.h>main(){ FILE *fp1; fp1=fopen("f1.txt","w"); fprintf(fp1,"abc"); fclose(fp1);}若文本文件f1.txt中原有内容为good,则运行以上程序后,文件f1.txt中的内容为A.goodabc B.abcd C.abc D.abcgood
[单选题]有如下程序:include main(){ FILE*fp1;fp1=fopen("f1.txt","w");fprintf(fp1, "abc");有如下程序: #include <stdio.h> main() { FILE *fp1; fp1=fopen("f1.txt","w"); fprintf(fp1, "abc"); fclose(fp1); } 若文本文件f1.txt中原有内容为good,则运行以上程序后文件f1.txt中的内容为( )。A.goodabc
[单选题]有如下程序includemain(){FILE*fp1;fp1;fopen("ftxt","w");fprintf(fpl, "abc")fclose有如下程序 #include <stdio.h> main() { FILE *fp1; fp1;fopen("ftxt","w"); fprintf(fpl, "abc") fclose(fpl); } 若文本文件f1.txt中原有内容为:good,则运行以上:程序后文件f1.Mt中的内容为A.goodabcB.abcdC
[单选题]有以下程序#include <stdio.h>main(){ FILE *fp; int i;char ch[]="abcd",t;fp=fopen("abc.dat","wb+");for(i=0; i<4; i++) fwrite(&ch[i],1,1,fp);fseek(fp,-2L,SEEK_END);fread(&t,1,1,fp);fclose(fp);printf("%c/n",t);}程序执行后的输出结果是A.)dB.)cC.)b
[单选题]有以下程序#include <stdio.h>main( ){ FILE *fp; int k,n,a[6]={1,2,3,4,5,6};fp=fopen("d2.dat","w");fprintf(fp, "%d%d%d/n",a[0],a[1],a[2]); fprintf(fp,"%d%d%d/n",a[3],a[4],a[5]);fclose(fp);fp=fopen("d2.dat", " r");fscanf(fp, "%d%d",&k
[单选题]有以下程序#include <stdio.h>main(){ FILE *fp; int a[10]={1,2,3},i,n;fp=fopen("dl.dat","w");for(i=0;i<3;i++) fprintf(fp,"%d",a[i]);fprintf(fp,"/n");fclose(fp);fp=fopen("dl.dat","r");fscanf(fp,"%d",&n);fclose(fp);printf("%d/n",n
[单选题]有以下程序#include <stdio.h>main(){ FILE *fp; int i=20,j=30,k,n;fp=fopen("d1.dat","w");fprintf(fp,"%d\n",i);fprintf(fp,"%d\n",j);fclose(fp);fp=fopen("d1.dat","r");fscanf(fp,"%d%d",&k,&n); printf("%d %d\n",k,n);fclose(fp);}程序运
[单选题]有以下程序#include<stdio.h>main(){F.ILE *fp; it a[10]={1,2,3,0,0};fp=fopen(“d2.dat”,”wb”);fwrite(a,sizeof(int),5,fp);fwrite(a,sizeof(int),5,fp);fclose(fp);fp=fopen(“d2.dat”,”rb”);fread(a,sizeof(int),10,fp);for(i=0;i<10;i++) printf(“%d”,A.;}程序运行结果
[单选题]有以下程序:include<stdio.h> main( ){ FILE*fp; int i,a[6]={1,2,3,4,5,6}; fp=fopen(&q有以下程序:include<stdio.h>main( ){ FILE*fp; int i,a[6]={1,2,3,4,5,6};fp=fopen("d2.dat","w+");for=(i=o;i<6;,i++)fpintf(fp,"%d/n",a[i
[单选题]有以下程序#include<stdio.h>main(){FILE *fp; int i,a[6]={l,2,3,4,5,6};fp=fopen("d3.dat","w+b");fwrite(a,sizeof(int),6,fp);fseek(fp,sizeof(int)*3,SEEK_SET);/*该语句使读文件的位置指针从文件头向后移动3个int型数据*/fread(a,sizeof(int),3,fp); fclose(fp);for(i=0;i<6;i++)pr