填空题
程序的结果为______。
#include"iostream.h"
template<typename T>
T total(T*data)
{
Ts=0;
while(*data)
{
S+=*data++;
}
return S;
}
int main()
{int x[]={2,4,6,8,0,12,14,16,18};
cout<<total(x);
retum 0;
cout<<endl;}
【参考答案】
T
点击查看答案&解析
<上一题
目录
下一题>
热门
试题
填空题
在声明派生类时,如果不显式地给出继承方式,缺省的类继承方式是私有继承private。已知有如下类定义:class Base protected:void fun();class Derived: Base ;则Base类中的成员函数fun(),在Derived 类中的访问权限是______(注意:要求填写 private、protected或public中的一项)。
点击查看答案
填空题
下列程序的输出结果是______。 #include<iostream.h> #include<string.h> void main() char b[30]; strcpy(&b[0], XY ); strcpy(&b[1], YZW ); strcpy(&b[2], ZXY ); cout<<b<<end1;
点击查看答案
相关试题
用以下语句调用库函数malloc,使字符指针st...
指针数组是由______构成的数组。