有以下程序#include stdio.hmain(){ FILE *pf;char *s1="China",*s2="Beijing";pf=fopen("abc.dat","wb+");fwrite(s2,7,1,pf);rewind(pf);fwrite(s1,5,1,pf);fclose(pf);}以上程序执行后 abc.dat 文件的内容是A)ChinaB)ChinangC)ChinaBeijingD)BeijingChina
有以下程序
#include <stdio.h>
main()
{ FILE *pf;
char *s1="China",*s2="Beijing";
pf=fopen("abc.dat","wb+");
fwrite(s2,7,1,pf);
rewind(pf);
fwrite(s1,5,1,pf);
fclose(pf);
}
以上程序执行后 abc.dat 文件的内容是
A)China
B)Chinang
C)ChinaBeijing
D)BeijingChina
相关考题:
有以下程序并includeincludefun(char * w,int n){char t,*s1,*s2; s1=w;s2= 有以下程序 并include<stdio.h> #include<string.h> fun(char * w,int n) { char t,*s1,*s2; s1=w; s2=w+n-1; while(s1<s2) { t=*s1++; * s1=*s2--; * s2=t; } } main() { char p[]="1234567"; fun(p,strlen(p)); puts(p); } 程序运行后的输出结果是( )A.1234567B.7654321C.1711717D.7177171
下列程序的运行结果是()。includeincludemain(){char*s1="abDuj"; char*s2= 下列程序的运行结果是( )。 #include<stdio.h> #include<string.h> main() { char*s1="abDuj"; char*s2="ABdUG"; int t; t=strcmp(s1,s2); printf("%d",t); }A.正数B.负数C.零D.不确定的值
有以下程序:includemain(){FILE *pf;char*s1="China",*s2="Beijing":pf=fopen("abc.da 有以下程序: #include<stdio.h> main() {FILE *pf; char*s1="China",*s2="Beijing": pf=fopen("abc.dat","wb+"); fwrite(s2,7,1,pf); rewind(pf); /*文件位置指针回到文件开头*/ fwrite(s1,5,1,pf); fclose(pf); } 以上程序执行后abc.dat文件的内容是( )。A.ChinaB.ChinangC.ChinaBeijingD.BeijingChina
有以下程序 include main() { FILE*pf, char *s1="China", 有以下程序 #include <stdio.h> main() { FILE*pf, char *s1="China",*s2="Beijing"; pf=fopen("abc.dat","wb+"); fwrite(s2,7,1,pf); rewind(pf); /*文件位置指针回到文件开头*/ fwrite(s1,5,1,pf); fclose(pf); } 以上程序执行后abc.dat文件的内容是______。A.ChinaB.ChinangC.ChinaBeijingD.BeijingChina
下面程序的运行结果是()。includeincludemain(){char*s1="abDuj";char*s2=" 下面程序的运行结果是( )。 #include<stdio.h> #include<string.h> main() {char*s1="abDuj"; char*s2="ABdUG"; int t; t=strcmp(s1,s2); printf("%d",t); }A.正数B.负数C.零D.不确定的值
有下列程序: #includestdi0.h voidmain( ) {FILE*pf; char*s1="China",*s2="Beijing"; pf=fopen("abc.dat","wb+"); fwrite(s2,7,1,pf); rewind(pf);/*文件位置指针回到文件开头*/ fwrite(s1,5,1,pf); fclose(pf); } 以上程序执行后abc.dat文件的内容是( )。A.ChinaB.ChinangC.ChinaBeijingD.BeijingChina
有以下程序:include main( ){ehar str[ ] [10] = { "China" ," Beijing" } , * p = 有以下程序: #include < stdio. h > main( ) { ehar str[ ] [10] = { "China" ," Beijing" } , * p = str[o]; printf( "% s \n", p + 10); }程序运行后的输出结果是( )。A.ChinaB.BeijingC.ngD.ing
有以下程序:include void swap(char * x,ehar * y){ char t;t= *x; *x: *y; *y=t;main 有以下程序:#include <stdio.h>void swap(char * x,ehar * y){ char t; t= *x; *x: *y; *y=t;main ( ){ char *s1 ="abc", * s2 ="123"; swap(s1 ,s2); printf("%s,%s \n" ,s1 ,s2);}程序执行后的输出结果是( )。A.123,abeB.abe,123C.1bc,a23D.321,cba
以下程序的输出结果是( )。 include main() {char*s1,*s2,m; s1=s2=(char*)malloc(size 以下程序的输出结果是( )。include<stdlib.h>main(){char*s1,*s2,m;s1=s2=(char*)malloc(sizeof(char));*s1=15;*s2=20;m=*s1+*s2:printf("%d\n",m);}