问题 填空题

已有定义如下:
struct node
int data;
struct node *next;
*P;
以下语句调用malloc函数,使指针p指向一个具有struct node类型的动态存储空间。
请填空。
p=(struct node *)malloc______;

答案

参考答案:sizeof(struct node)或4

解析: C标准规定malloc()函数返回值的类型为void*,函数的调用形式为:malloc (size)。要求size的类型为unsigned int,所以该空格处应该填sizeof(struct node)或4。

阅读理解

An astronaut’s work may sound exciting, but living in space isn’t as fun as you think. The website www.space.com lists the disadvantages of living in space. Here are some of them.

When astronauts work outside the station during spacewalks, they have to wear special gloves. The gloves are very tight. They can hurt the astronauts’ fingernails(手指甲) and even make them fall off.

In space, you don’t have many choices in what you eat. It’s hard to get fresh fruits and vegetables. It is not OK to eat bread because it leaves crumbs(碎屑). Crumbs could fly around everywhere.

In space, it is impossible to have a good shower because water can fly all over the ship and break the machines. Astronauts have to use a special water-shooting(喷水) gun and a washcloth.

Astronauts lose their bone strength quickly during their stay in space. So far, there is no way to solve this problem. They do exercise while they’re in space to try to keep their bones strong as long as possible.

Perhaps the hardest part of life in space is the feeling of loneliness. Astronauts sometimes have to spend weeks and even months away from Earth. They miss their friends and families.

小题1:People often think the life in space is       .

A.terrible

B.lonely

C.hard

D.fun小题2:What may hurt astronauts fingernails while working in space?

A.Washcloth.

B.The special gloves.

C.The water-shooting gun.

D.Crumbs.小题3:. How do the astronauts have a good shower in space?

A.By eating bread.

B.By breaking the machines.

C.By using a special water-shooting gun and a washcloth.

D.By wearing gloves.小题4: How do the astronauts keep their bones strong in space?

A.By taking medicine.

B.By doing exercise.

C.By taking a good rest.

D.By walking in space.小题5: What’s the hardest part of life for astronauts in space?

A.They feel very lonely.

B.They have to stay alone in space.

C.They have no friends.

D.They have no families.

填空题