首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
下面不属于同一函数模板的是( )。
下面不属于同一函数模板的是( )。
admin
2009-01-15
128
问题
下面不属于同一函数模板的是( )。
选项
A、template<class t1> t1 max(t1 &a,t1 &b) {…}template<class t2> t2 max(t2 &a,t2 &b) {…}
B、template<class t1>t1 max(t1 a,t1 b){…}template<class t2>t2 max(t2 &a,t2 &b){…}
C、template<class t1> t1 max(t1 * a,t1 * b) {…} template<class t2> t2 max(t2 &a,t2 &b) {…}
D、template<class t1>t1 max(t1 a,t1 b){…}template<class t2>t2 max(t2 &a,t2 &b,t2 c){…}
答案
8
解析
函数模板的重载是靠模板参数的数量不同来区分的,因为函数模板是抽象的,有待于进一步实例化,所以靠参数类型无法区别调用哪个函数模板。
转载请注明原文地址:https://kaotiyun.com/show/Dtkp777K
本试题收录于:
二级C题库NCRE全国计算机二级分类
0
二级C
NCRE全国计算机二级
相关试题推荐
以下叙述中正确的是()。
下列给定程序中,函数fun的功能是:找出一个大于给定整数m且紧随m的素数,并作为函数值返回。请改正程序中的错误,使它能得出正确的结果。注意:不要改动main函数,不得增行或删行,也不得更改程序的结构!试题程序:#include<stdlib.h>
有以下程序#include<stdio.h>#include<stdlib.h>voidfun(int*p1,int*p2,int*s){s=(int*)calloc(1,sizeo
以下选项中能正确定义二维数组的选项是()。
定义如下变量和数组:inti,x[3][3]={1,2,3,4,5,6,7,8,9};则下面语句的输出结果是()。for(i=0;i<3;i++)printf("%d",x[i][2-i]);
下面程序运行后的输出结果是()。#include<stdio.h>main(){inta[5]={1,0,4,2,0},b[5]={1,2,3,4,5),i,s=0;for(i=0;i<5;i++
以下关于逻辑运算符两侧运算对象的叙述中正确的是()。
下面描述中不属于软件需求分析阶段任务的是()。
由以下while构成的循环,循环体执行的次数是intk=0;while(k=1)k++;
在C++中,用于实现运行时多态性的是()。
随机试题
下列各项中,属于常规授权的是
骨骼肌细胞兴奋一收缩耦联的关键因素是()。
根据资料,回答下列问题:2012年,某地区农作物播种总面积达到1625.55万亩,同比增长4.6%。其中,粮食和蔬菜播种面积大幅增长,分别为459.40万亩、109.06万亩,同比增长32.7%和30.5%;棉花、油料和甜菜播种面积下降,分别为698.
(2014年第31题)中华民族的爱国主义优良传统源远流长,内涵极为丰富,下列诗句中反映爱国主义优良传统的有
Theterme-commercereferstoallcommercialtransactionsconductedovertheInternet,includingtransactionsbyconsumersandb
排序是计算机程序设计中的一种重要操作,常见的排序方法有插入排序、______和选择排序。
Whatdidwomenusuallydobeforetheirmarriage?
Wheredoesthewomanwork?
"Museum"isaslipperyword.Itfirstmeant(inGreek)anythingconsecratedtotheMuses:ahill,ashrine,agarden,afestival
DearMr.Green,Pleaseshipusorangemarmalade(柑橘酱)asperthefollowingterms:Quantity:20,000jarsUnit:1kgperj
最新回复
(
0
)