问题 单项选择题

设有语句:char str1[]="string",str2[8],*str3,*str4="string";,则下列对库函数strcpy调用不正确的是

A.strcpy(str1,"Hello1");

B.strcpy(str2, "Hello2");

C.strcpy(str3, "Hell03");

D.strcpy(str4, "Hell04");

答案

参考答案:C

解析: 本题考核函数调用。函数strcpy的函数原型为:char* strcpy(char* strDest, const char* strSrC) ;,其功能是复制strSrc所有字符到 strDest,并返回strDest。根据函数strcpy的原型可知选项A) ,B) 和D) 的调用都是正确的。在C) 选项中,由于指针*str3没有初始化其字符长度,容易引起访问越界,故是不正确的。

阅读理解

Dream Theatre
Telephone number (020)7928 3232
Open: 11.30 a.m.—8.30 p.m. from Monday to Sunday
Ticket prices:
Member price: 30 yuan
Usual price: 40 yuan
Student ticket(学生票): 15 yuan
 
Sunshine cinema
Telephone number: (020)8586 7799
(020)8586 8989
Open: 9 a.m. —8.30 p.m. from Monday to Sunday
Ticket prices:
40 yuan (half price on Tuesdays)
No student tickets.
 
Palace Cinema
Telephone number: (020)8899 1212
Open:
Monday to Friday: 10.30 a.m. —11.30 p.m.
Saturday to Sunday: 10 a.m. —11.30 p.m.
Ticket prices:
Children (under 14 year old):10 yuan
Young people(14 years old to 18 years old): 20 yuan
Adults: 50 yuan
Old people (over 60 years old) :20 yuan
6. If Mr. Green wants to buy a film ticket at 8.40 p.m., he can call______.
A. (020)7928 3232   B. (020)8899 1212   C. (020)8586 7799   D. (020)8586 8989
7. If Tom’s father is a member of Dream Theatre, he will pay _____ when he watches a play there.
A. 10 yuan   B. 20 yuan   C. 30 yuan   D. 40 yuan
8. How long is Sunshine Cinema open every day?
A. For nine hours.          B. For eleven and a half hours. 
C. For thirteen hours.       D. For twelve and a half hours.
9. If you go to Sunshine Cinema on Tuesdays, you will pay ______.
A. 80 yuan   B. 50 yuan   C. 40 yuan   D. 20 yuan
10. Which of the following is right?
A. You can go to Dream Theatre on Mondays at 8.30 a.m.
B. Old people only have to pay 10 yuan when they go to Palace Cinema.
C. Palace Cinema is open from 10 a.m. to 11.30 p.m. on weekends.  
D. You can buy student tickets in Sunshine Cinema.
单项选择题 B1型题