首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
下列函数模板的定义中,合法的是( )。
下列函数模板的定义中,合法的是( )。
admin
2019-05-06
35
问题
下列函数模板的定义中,合法的是( )。
选项
A、template
T abs(T x){return x<0?一x:x;}
B、template class
T abs(T x){return x<0?一x:x;}
C、template T
abs(T x){return x<0?一x:x;}
D、template T abs(T x){return x<07一x:x;}
答案
A
解析
本题考查模板函数的基本概念,根据模板函数的定义,所以答案为A。
转载请注明原文地址:https://kaotiyun.com/show/Xs8p777K
本试题收录于:
二级C题库NCRE全国计算机二级分类
0
二级C
NCRE全国计算机二级
相关试题推荐
有如下程序:#include<iostream>usingnamespacestd;className{charname[20];public:Name(){strepy(name,"");tou
下列程序的输出结果为:Objectid=0Objectid=1请将程序补充完整。#include<iostream>usingnamespacestd;classPoint{publ
软件是程序、数据和______的集合。
有如下程序:#include<iostreanl>usingnamespacestd;classMyClass{public:MyClass(intx):val(x){}voidSet(intx
下列关于模板的叙述中,错误的是
补充完整下面的类定义:constdoublePI=3.14;classCircle{//圆形物体的抽象基类protected:doubler;//半径public:Circ
下面程序的运行结果是()。#include<iostream.h>intx=5;intfan(inta){intc;c=x*a;returnc;}voidmain(
下面关于数据库三级模式结构的叙述中,正确的是()。
A、 B、 C、 D、 A线性表、栈、队列和双向链表都是典型的线性结构;而二叉树是典型的非线性结构。【知识拓展】什么是线性结构?有3个衡量标准:①有且只有一个根结点;②每个结点最多有一个前件(直接前驱),也
A、 B、 C、 D、 BE-R图具有三个要素:①实体(型)用矩形框表示,框内为实体名称;②属性用椭圆型来表示,并用线与实体连接。属性较多时也可以将实体及其属性单独列表;③实体间的联系用菱形框表示。用线将菱形
随机试题
求由方程表示的函数的一阶导数dy/dx和二阶导数d2y/dx2.
委托代理人为了被代理人的利益转委托他人代理时,下列情况中,复代理人代理行为的法律后果由被代理人直接承担的是()。
患者,男性,60岁。因“四肢不自主抖动伴运动不灵活7年”入院。该患者于7年前无明显诱因出现左上肢轻微震颤。2年后左下肢亦出现震颤,特别是在静止时明显,左侧肢体活动欠灵活,动作迟缓。入院前3年患者右侧上、下肢亦相继出现震颤,并逐渐加重,情绪紧张时加剧,入睡后
6岁女童,喜食泥块,面色萎黄,Hb92g/L,应给下列何种药物治疗
慢性肺心病急性加重期综合治疗措施包括
某外商甲与国内企业乙约定设立中外合作企业,下列关于甲乙合作方式的描述中,正确的有()。
第二次世界大战中,世界人民为了战胜法西斯建立了广泛的反法西斯同盟,该同盟形成的标志是()。
对比性分析:《唐律疏议·名例律》:“诸本条别有制,与例不同者,依本条。”《大明律附例·名例律》:“凡律自颁降日为始,若犯在已前者,并依新律拟断。”问题:这两段文字反映了什么问题?为什么会出现这种问题?
设an>0,bn>0,(n=1,2,…),且满足试证:(Ⅰ)若级数an收敛;(Ⅱ)若级数bn发散.
小向使用了一部标配为2GRAM的手机,因存储空间不够,他将一张64G的mircoSD卡插到了手机上。此时,这部手机上的2G和64G参数分别代表的指标是()。
最新回复
(
0
)