问题

有以下程序

#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)d

B)c

C)b

D)a

参考答案
您可能感兴趣的试题
  • 【 2 】 的任务是诊断和改正程序中的错误。
  • 按 “ 先进后出 ” 原则组织数据的数据结构是 【 4 】 。
  • 数据结构分为线性结构和非线性结构,带链的队列属于 【 5 】 。
  • 设有定义: float x=123.4567; ,则执行以下语句后的输出结果是 【 6 】 。printf(%f\n,(int)(x*100+0.5)/100.0);
  • 以下程序运行后的输出结果是 【 7 】 。main(){ int m=011,n=11;printf(%d %d\n,++m, n++);}
  • 以下程序运行后的输出结果是 【 8 】 。main(){ int x,a=1,b=2,c=3,d=4;x=(ax) ? x : d;printf(