问题 单项选择题

关于关键字class和typename,下列表述正确的是

A.程序中所有的typename都可以替换为class

B.程序中所有的class都可以替换为typename

C.A和B都正确

D.A和B都不正确

答案

参考答案:A

解析: 本题考核模板的概念。 C++中,模板形参具有三种形式:(1)typename<参数名>,(2)class<参数名>,(3)<类型修饰符><参数名>,前两种形式是等价的,在声明模板参数时,关键字typename和class可以互换。但是在定义类的程序中,关键字class代表的含义是类,此时不能用 typename代替。

单项选择题
完形填空
This little story I’m about to tell you happened when I was 11 years old, and I’ll never forget it.
It was at my friend Jenny’s house after 36 one day, and we were doing our homework. While I was there, a friend of Jenny’s mom came over to 37. I didn’t know her name or 38 what her face looked like. I just 39 her hands, her voice and the lesson I 40 from her.
I can’t forget that she 41 her hands to introduce herself. It was so 42, I thought, rich fine skin; then I heard her saying, “Oh no, that is not 43 you shake hands. Let me teach you.” She didn’t do that at all in a condescending (屈尊的) manner. 44 that, I just remember her voice explaining the 45 of a good handshake of conveying (传达) a   46 sense of self-belief, of looking the other person in the eyes, and of making a warm  47. Hearing her friendly words, I first understand what being 48 meant.
I admired her for 49 time to teach me about one of the important things in life. I was grateful for her not talking down to me 50 I was 11 and didn’t know much. I also felt somewhat admired by the way she 51 me. It felt good to be talked to as a(n) 52, rather than as an 11-year-old child. I also 53 her telling me that if someone isn’t aware of something you should show him or her the right direction; don’t be afraid to 54 your knowledge.
I think of her every time I meet someone 55, and I’m so thankful for her little lesson.
小题1:
A.breakfastB.workC.sleepD.school
小题2:
A.readB.checkC.visitD.live
小题3:
A.evenB.certainlyC.everD.simply
小题4:
A.watchB.rememberC.holdD.seize
小题5:
A.learnedB.selectedC.wantedD.discovered
小题6:
A.raised upB.hung upC.reached outD.put out
小题7:
A.paleB.beautifulC.roughD.small
小题8:A whom        B .why            C .when            D. how
小题9:
A.AfterB.BeforeC.DuringD.Through
小题10:
A.necessityB.styleC.importanceD.rule
小题11:
A.weakB.positiveC.differentD.special
小题12:
A.friendB.voiceC.heartD.atmosphere
小题13:
A.respectedB.noticedC.servedD.praised
小题14:
A.havingB.takingC.arrangingD.keeping
小题15:
A.whenB.butC.becauseD.so
小题16:
A.treatedB.protectedC.encouragedD.required
小题17:
A.boyB.studentC.teacherD.adult
小题18:
A.hatedB.mindedC.appreciatedD.understood
小题19:
A.testB.shareC.increaseD.control
小题20:
A.healthyB.smartC.familiarD.new