首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
下列函数模板的定义中,合法的是( )。
下列函数模板的定义中,合法的是( )。
admin
2020-06-29
32
问题
下列函数模板的定义中,合法的是( )。
选项
A、template
T abs(T x){return x<0?-x:x;}
B、template class
T abs(T x){return x<0.9-x:x;}
C、template T
abs(T x){return x<0.9-x:x;}
D、template T abs(T x){return x<0.9-x:x;}
答案
A
解析
本题考查模板函数的基本概念,根据模板函数的定义,所以答案为A。
转载请注明原文地址:https://jikaoti.com/ti/jsA0FFFM
本试题收录于:
二级C题库NCRE全国计算机二级分类
0
二级C
NCRE全国计算机二级
相关试题推荐
当使用ofstream流类定义一个流对象并打开一个磁盘文件时,文件的默认打开方式为()。
为了提高函数调用的实际运行速度,可以将较简单的函数定义为()。
有如下程序段:inti=4;intj=1;intmain(){inti=8,j=i;cout<<i<<j<<endl;}运行时的输出结果是()。
有如下程序:#includeusingnamespacestd;classSample{friendlongfun(Samples);Sample(10nga){x=a;}priv
下列程序段中包含4个函数。其中具有隐含this指针的是()。intfunl();classTest{public:intfura();friendintfun3();static
有如下程序:#includeusingnamespacestd;classXA{inta;public:staticintb:XA(intaa):a(aa){b++;)
下列关于this指针的叙述中,正确的是()。
使用VC6打开考生文件夹下的源程序文件modi2.cpp。阅读下列函数说明和代码,补充空出的代码。函数convert(char*des,char*str)的功能是去掉字符串str中相同的字母,并将处理后的结果存到des所指的字符串中。例如:输入:T
随机试题
女性,45岁,外伤致左股骨颈骨折,X线片示股骨颈完全骨折,股骨头有旋转并且部分移位,骨折部位位于股骨颈中部。该患者股骨颈骨折按Garden分型法为
清洁灌肠时一般取
碾压混凝土的主要特点是()。
储罐充水试验中应进行基础沉降观测。在罐壁下部圆周每隔10m左右设一个观测点,点数宜为()且不得少于4点。
()年,深圳证券交易所开办以国债为主的质押回购。
代理是代理人根据被代理人的委托或代理权,以()的名义实施民事法律行为,其后果直接归属于被代理人的行为。
设定KPI和指标值时,一般不会选取()作为参考标杆。
美国的警政管理体制为()。
经过20多年的自然保护,甘肃祁连山区野生动物的数量大大增加,活动于甘州一带的野生岩羊经常闯入牧场,侵食牧草,糟蹋草场。山丹马场放牧的羊时常被出没的狼群活活咬死。岩羊的天敌是雪豹和狼,山丹马场距甘州不过百余公里,但甘州的岩羊却未遭狼群侵害。如果以下
Answerquestions71~80byreferringtothefollowinggames.Note:AnswereachquestionbychoosingA,B,CorD.Somechoices
最新回复
(
0
)