问题 单项选择题

设有如下的程序段:
char str[]="Hello";
char *ptr;
ptr=str;
执行完上面的程序段后,*(ptr+5)的值为( )。

A.'o'

B.'\0'

C.不确定的值

D.'o'的地址

答案

参考答案:B

解析: 本题考杏字符数组的结束标志。ptr=str是将串str的首地址赋给了指针变量ptr,所以ptr+5指向字符串str的第六个数组元素,即是串的隐含结束标志'\0',*(ptr+5)='\0',最后的结果为'\0'。

阅读理解

There was a beautiful garden. Every year the king would go to the garden to decide which flower was the most beautiful one.

For the last few years, the rose was always Number One. Because of this, the rose Gulaab became arrogant. It would never let birds stay on its flower. Then all the birds started staying away from Gulaab.

Behind Gulaab, there was a little yellow flower. People called it Junglee. Junglee wasn’t more beautiful than Gulaab, but it welcomed the birds to stay on its flower. All the birds in the garden liked it.

This year the king went to the garden as before. The gardener pointed at the rose and said to the king, “ Your favourite flower, my king.”

Of course, the king also saw the yellow flower behind it and asked, “What flower is that?”

“Oh! That’s Junglee, a wild flower.”

“ I didn’t see a flower like it before. There are so many birds on it. I think it’s much more beautiful than the rose. It will be the King Flower of this year!” said the king.

小题1:From the passage, we can know that Junglee was _________.

A.famous

B.serious

C.friendly

D.smart小题2:What does the underlined word “arrogant” mean in Chinese?

A.傲慢的

B.粗心的

C.易怒的

D.开朗的小题3:What do you think this passage is?

A.An ad.

B.A story.

C.A diary.

D.A piece of news.小题4:Which of the following is TRUE according to the passage?

A.All the birds liked Gulaab.

B.The birds liked to stay on Junglee.

C.Gulaab was not beautiful this year.

D.The king didn’t like Junglee.小题5:What is the best title for the passage?

A.The king’s garden

B.The clever king

C.The flowers and the birds

D.The most beautiful flower

选择题