问题 单项选择题

有以下程序:
main()

char *S[]="one","two","three",*p;
p=s[1];
printf("%c,%s\n", *(p+1), s[0]);

执行后输出结果是( )。

A.n,two

B.t,one

C.w,one

D.o,two

答案

参考答案:C

解析: 本题首先定义了一个有3个元素的指针数组s,并通过初始化列表使s[0]指向字符串“one”,s[1]指向字符串“two”,s[2]指向字符串“three”,然后通过赋值语句p=s[1],使p指向了字符串“two”,故*(p+1)就是字符‘w’。所以,C选项为所选。

材料分析题
问答题

Molefi is one of the three directors of Modern Cars Ltd, a specialist car manufacturer. The company’s articles are in the form of Table A of the Companies Act, 1967. All the directors own 100 shares each in the company. The paid-up capital of the company is R100,000 divided into 100,000 shares of R1 each.Modern Cars Ltd are offered a profi table opportunity by Suzuki to build a car that would use solar batteries instead of petrol. Molefi recommends to the board that the company should accept the challenge. Molefi knows that as an expert in tapping solar power, this project could enhance his reputation world-wide. Modern Cars Ltd inform Suzuki that they would build the car, but that it would take a minimum of three years. Molefi is overruled by other directors that the car could be built in less than three years. Suzuki is not willing to wait that long.Suzuki then approaches Molefi personally and invites him to build the car. Molefi accepts the contract, builds the car in 18 months and reaps a large profi t from the contract.The board of Modern Cars Ltd decide to take legal action against Molefi . At the annual general meeting, Molefi resigns after explaining how he was overruled by his other directors. Molefi then pleads with the shareholders not to authorise any legal action against him. The shareholders by a large majority resolve: ‘Modern Cars Ltd shall take no legal action against Molefi arising out of any events connected directly or indirectly to the solar battery car contract with Suzuki.’Required:Advise the directors of Modern Cars Ltd if they could authorise legal action against Molefi . (10 marks)