问题 单项选择题

以下语句或语句组中,能正确进行字符串赋值的是______。

A.char *sp;*sp="right!";

B.char s[10];s="right!";

C.char s[10];*s="right!";

D.char *sp="right!";

答案

参考答案:D

解析:选项 A 定义了字符型的指针变量 sp,则*sp 存储的是第一个字符,而给它赋的是字符串,故错; 选项 B 表示代表数组的首地址,而题中给它赋的是字符串,所以错误;选项 C 定义了一个字符型的数组 s[10],再通过*s 给数组元素赋初值,这时是与选项 A 相同的错误。

判断题
阅读理解

阅读理解。

     In choosing a friend, one should be very careful. A good friend can help you study. You

can have fun together and make each other happy. Sometimes you will meet fair weather

friends. They will be with you as long as you have money or luck, but when you are down,

they will run away. How do I know when I have found a good friend? I look for certain qualities

(品质) of character, especially understanding, honesty and reliability (可靠).

     Above all else, I look for understanding in a friend. A good friend tries to understand how

another person is feeling. He is not quick to judge. Instead, he tries to learn from others. He

puts himself in the other person's place, and he tries to think of ways to be helpful. He is also

a good listener.

     At the same time, however, a good friend is honest. He does not look for faults (过错) in

others. He notices their good points. In short, a friend will try to understand me and accept me.

Another quality of a friend is reliability. I can always depend on (信赖) a good friend. If he t

ells me he will meet me somewhere at a certain time, I can be sure that he will be there. If I

need a favor, he will do his best to help me. If I am in trouble, he will not run away from me.

     There is a fourth quality that makes a friend special. A special friend is someone with whom

we can have fun. We should enjoy our lives, and we would enjoy our friendship. That is why I

especially like friends who are fun to be with. A good friend likes the same things I like. We

share experience (经验) and learn from each other. A good friend has a good sense of humor

(幽默), too. He likes to laugh with me. That is how we share in the joy of being friends. And I

know that he is looking for the same quality in me.

     When I meet someone who is reliable, honest, and understanding, I know I've found a friend!

1. Which of the following qualities the writer thinks is the most important in choosing a friend?

A. understanding.    

B. honesty.  

C. reliability.    

D. a sense of humor.

2. If you have fair weather friends, ______ .

A. they will give you all that they have when you need help

B. you will be refused when you get into trouble

C. you will become rich

D. you can be sure that you get real friends

3. Good friends need to ______.

A. always point out each other's mistakes  

B. be helped with money

C. understand each other's feelings    

D. have money or luck

4. This passage mainly discuss ______ .

A. the qualities of a friend        

B. where to choose friends

C. how to get along with friends  

D. the importance of having a friend