首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
下列模板声明中,有语法错误的是( )。
下列模板声明中,有语法错误的是( )。
admin
2016-11-25
34
问题
下列模板声明中,有语法错误的是( )。
选项
A、template
T fun(T x){return x;}
B、template
T fun(T x,int n){return x*n;}
C、template
T fun(T*p){return*p;}
D、template
T classA{T n;};
答案
D
解析
第四个选项是定义类模板的,但是class前面的T是多余的。对于第二个选项,同一个类的对象相乘还是同一个类的对象,但是可能要考虑溢出的问题。
转载请注明原文地址:https://jikaoti.com/ti/zrt0FFFM
本试题收录于:
二级C题库NCRE全国计算机二级分类
0
二级C
NCRE全国计算机二级
相关试题推荐
下面的程序段中,有()处错误和警告。#include<stdio.h>intmain()intx;cin>>xcout<<x;}
一个向量第1个元素的存储地址是100,每个元素的长度为2,则第5个元素的地址是()。
排序是计算机程序设计中的一种重要操作,常见的排序方法有插入排序、______和选择排序等。
下面程序的运行结果为#include<iostream.h>classA{intnum;public:A(int){num=i;}A(ABm){num=a.n
在下面四个选项中,()是用来声明虚函数的。
下列运算符中全都可以被友元函数重载的是
设有下列二叉树:对此二叉树前序遍历的结果为
下列关于关系运算的叙述中正确的是
如果在一棵二叉树中有17个度为2的结点,则该二叉树中有【 】个叶子结点。
随机试题
下列各项可见于肺炎链球菌肺炎患者的是
下列哪项不是甲状腺乳头状癌的常见特征
百部来源于百部科以下哪种植物的块根
某县人民法院对一起故意伤害案件作出判决后,如果县人民检察院认为该判决确有错误,提出了抗诉,下列哪些说法是正确的?()
利用废气、烟气、高温废液等作为热媒时可以不考虑()。
下列四幅简图中哪幅图为梯田?[2003-2]
因下列事项而减少的固定资产,不通过“固定资产清理”账户核算的有()。
税法与刑法是从不同的角度规范人们的社会行为。下列有关税法与刑法关系的表述中.正确的有()。
新课改实施中,小学阶段主要是()。(2016.广西)
AccordingtotheHadleyCentre,whatisgoingtohappenbythe2050s?
最新回复
(
0
)