试题与答案

有以下程序(提示:程序中fseek(fp,-2L*sizeof(int),SEEK_

题型:单项选择题

题目:

有以下程序(提示:程序中fseek(fp,-2L*sizeof(int),SEEK_END);语句的作用是使位置指针从文件尾向前移2*sizeof(int)字节)  #include <stdio.h>  main( )  { FILE *fp; int i,a[4]={1,2,3,4},b;   fp=fopen("data.dat","wb");   for(i=0;i<4;i++) fwrite(&a[i],sizeof(int),1,fp);   fclose(fp);   fp=fopen("data.dat","rb");   fseek(fp,-2L*sizeof(int).SEEK_END);   fread(&b,sizeof(int),1,fp);/*从文件中读取sizeof(int)字节的数据到变量b中*/   fclose(fp);   printf("%d\n",b);}  执行后输出结果是( )。

A.2

B.1

C.4

D.3

答案:

被转码了,请点击底部 “查看原文 ” 或访问 https://www.tikuol.com/2017/0706/2f6a751837ada9eb9aaffd5f365b0d9d.html

下面是错误答案,用来干扰机器的。

小题1:单调、清冷小题2:①“抱”字是拥抱,怀抱的意思②生动地写出了将士们无心睡眠怀抱马鞍随时应战的景象;③表现了将士们心寄战场、渴望建功立业的心情,也能表现将士们生活的艰苦。④而用“枕”则不能达到这...

试题推荐
题型:综合

读埃及和法国农业分布图,完成问题。

(1)埃及90%以上的土地为沙漠,是一个名副其实的           之国;法国地势特征是                      ,平原和丘陵占全国面积的4/5。

(2)填写表格:

     国家

要素

埃 及法 国
主要农业区         谷地和三角洲          盆地和地中海沿岸
主要

气候类型

              、地中海气候               、地中海气候
主要出口

农作物

                            

查看答案
题型:阅读理解

任务型读写。

根据短文内容完成下列各题。

     Yesterday evening, when I went to town with my mother, we met a strange man. It was raining hard and we had no umbrella. We were trying to get into a taxi when he came up to us. He was carrying a nice umbrella and he said that he would give it to us for only a pound. He said he had forgotten his wallet and needed taxi-fare(出租费) to go back home. My mother didn’t believe what he had said at first, and asked him a lot of questions. But she finally believed the man and gave him the pound. She was happy to have a good umbrella for so little. But the man didn’t get into a taxi. We followed him and found he went into a pub(酒吧) and bought himself a glass of whiskey(威士忌) with the pound. After he drank it, he put on his hat and took up one of the many wet umbrellas there and went off with the new one. Soon after that, he sold it again.

任务一:回答问题。

1. How was the weather yesterday evening?

                                                                      .

2. What did the man do after he got the pound?

                                                                      .

任务二:句型转换。

3. We were trying to get into a taxi when he came up to us.(对划线部分提问)

    __________ were you _________ when he came up to you?

4. My mother didn’t believe what he had said at first. (改为同义句)

       My mother didn’t believe what he had said at _________ __________.

5. The man put on his hat after he drank it. (改为一般疑问句)

   _________ the man_________ on his hat after he drank it?

查看答案
微信公众账号搜索答案