首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
下列模板声明中,有语法错误的是
下列模板声明中,有语法错误的是
admin
2021-09-05
24
问题
下列模板声明中,有语法错误的是
选项
A、template
Tfun(Tx){returnx;}
B、template
Tfun(Tx,intn){returnx*n;}
C、template
Tfun(T*p){return*p;}
D、template
TclassA{Tn;};
答案
D
解析
本题考查模板的定义,B选项中x为T类型的,n为int型的,但是x*n就不一定是T类型的,所以错误。
转载请注明原文地址:https://kaotiyun.com/show/Wz5p777K
本试题收录于:
二级C题库NCRE全国计算机二级分类
0
二级C
NCRE全国计算机二级
相关试题推荐
关于在调用模板函数时模板实参的使用,下列表述中正确的是()。
已知类X中一个成员函数的原型声明为“voidCopy(X&r);”,则下列选项中,解释正确的是()。
若要对Data类中重载的加法运算符成员函数进行声明,下列选项中正确的是()。
下列关于派生类的叙述中,错误的是()。
下列有关类继承的叙述中,错误的是()。
若已定义了类Vehicle,则下列派生类定义中,错误的是()。
随机试题
在新药评价初期药物化合物的安全系数可表示为
不适用高压蒸汽灭菌法的物品是( )。
女,68岁。突发上腹阵发性绞痛2小时,短时间内寒战、高热,小便呈浓茶样,随后嗜睡。查体:T39.6℃,P128次/分,R30次/分,BP80/50mmHg。神志不清,躁动,巩膜黄染,右上腹肌紧张,有压痛和反跳痛。急症手术最有效的手术方式是()
某企业使用霉变面粉加工馒头,潜在受害人不可确定。甲、乙、丙、丁等20多名受害者提起损害赔偿诉讼,但未能推选出诉讼代表人。法院建议由甲、乙作为诉讼代表人。但丙、丁等人反对。关于本案,下列哪一选项是正确的?(2011年试卷三第48题)
某房地产开发企业2017年需要缴纳的下列税种中,应向该市地方税务局主管税务机关申报缴纳的有()。
简述教师提高知识直观效果的措施。
【租界】华东师范大学2003年中国近现代史真题;南京大学2003年中国近现代史真题;河北大学2014年历史学基础真题
患者是一个懂事理、听话的女孩,个性比较内向、敏感、好担心、追求完美。两年前读高中时,有一天路上与老师相遇,感到紧张,没有抬头和老师说话,低着头匆匆走过。旁边有一同学看到这一情形,对她说:“你不和老师说话,老师直用眼看你。”患者听后深感内疚,第二天到学校时,
Whetheryou’reaNewJerseymallratorafarmerinIndia,beingpoorcanexhaustyoursmarts.Thefindingsindicatethatan
Howcanforeign-traineddoctorsgetapprovedfromtheEducationalCommissiontocompletearesidencyintheU.S.?
最新回复
(
0
)