问题 单项选择题

有如下函数模板:
template<typename T,typenaine U>
T cast(U u)return u;
其功能是将U类型数据转换为T类型数据。已知i为int型变量,下列对模板函数cast的调用中正确的是

A) cast(i);
B) cast<>(i);
C) cast<char*,int>(i); D) cast<double,int>(i);

答案

参考答案:D

解析: 选择A、B错在没有给T参数类型,在函数的返回值中应该为T确定一个确切的类型。选项C错在赋给T的类型和函数中返回值的类型不匹配,故答案为D。

判断题
完形填空

任务型阅读。(每小题2分,共10分)

‘For those who have never been to Tibet(西藏), Tibet is a dream; for those who have ever been there, (1) forget, never, an, is, you, Tibet, experience, will.’ said Li Wan, a graduate(毕业生) from Zhongshan University.

Li Wan became interested in Tibet after having worked in a company(公司) for less than three months. Since 1998, Li Wan has been spending most of her time on the challenge(挑战) ---she has got to almost every corner of Tibet during the 8 years.

Li Wan’s first trip to Tibet was only out of her loving freedom. She entered Tibet along the Yunnan-Tibetan Road. Although she couldn’t say a word of Tibet language, this did not really (2) s_________ her from talking with local people successfully. ‘To me, they are free, friendly, happy and close to nature. (3)People should live in this way, singing while working, dancing while living,’ Li Wan said.

Li Wan describes Tibet in words and photos. ‘My dream in the next ten years is to make a good documentary(纪录片) about Tibet,’ said Li Wan.

小题1:将(1)处的单词连成一个通顺的句子。__________________________________________

小题2:在(2)处填上一个单词使句子完整。____________________________________________

小题3:将(3)处的句子翻译为汉语。__________________________________________________

小题4:What are the local people in Tibet like? __________________________________________

小题5:What is the writer’s dream in the next ten years? ___________________________________