首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
有如下类声明: class SAMPLE { int n; public: SAMPLE(int i=0):n(i){ } void setValue(int n0); }; 下列关于getV
有如下类声明: class SAMPLE { int n; public: SAMPLE(int i=0):n(i){ } void setValue(int n0); }; 下列关于getV
admin
2021-06-10
27
问题
有如下类声明:
class SAMPLE
{
int n;
public:
SAMPLE(int i=0):n(i){ }
void setValue(int n0);
};
下列关于getValue成员函数的定义中,正确的是( )。
选项
A、SAMPLE∷etValue(int n0){n=n0;}
B、void SAMPLE∷setValue(int n0){n=n0;}
C、void setValue(int=n0){n=n0;}
D、setVa]ue(int n0){n=n0;}
答案
B
解析
本题考查在类外定义类的成员函数,需要使用作用域限定符“∷”,属于基础知识,本题答案为B。
转载请注明原文地址:https://kaotiyun.com/show/2kfp777K
本试题收录于:
二级C题库NCRE全国计算机二级分类
0
二级C
NCRE全国计算机二级
相关试题推荐
有如下程序:#includeusingnamespacestd;classA{public:staticinta;voidinit(){a=10;}A(inta=5){init
请使用VC6或使用【答题】菜单打开考生文件夹proj1下的工程proj1,此工程包含一个源程序文件proj1.cpp。其中位于每个注释“//ERROR****found****”之后的一行语句存在错误。请改正这些错误,使程序的输出结果为:Youaref
深度为7的完全二叉树中共有125个结点,则该完全二叉树中的叶子结点数为
有如下类声明:classWd{inta;public:intb;intc;private:
有如下类定义:classFather{//基类public:Father(strings):name(s){}private:stri
请使用VC6或使用【答题】菜单打开考生文件夹proj2下的工程proj2,此工程包含有一个源程序文件proj2.cpp,其中定义了Stack类和ArrayStack类。stack是一个用于表示数据结构“栈”的类,栈中的元素是字符型数据。Stack
下列关于重载运算符错误的是
已知TV是一个类,并有函数func定义如下:voidfunc(){TVli,*net[2],company[3];}则在调用func()后,TV类的析构函数被调用的次数是
下列字符串中可以用作C++标识符的是()。
C什系统预定义了4个用于标准数据流的对象,下列选项中不属于此类对象的是()。
随机试题
喉口()
瘀血形成最常见的病因之一是
下列关于证据收集的说法中哪一个是正确的?()
WT对策是指()。
在( )模式条件下,业主不聘请“工程师”(即我国的监理工程师)来管理工程,而是自己或委派业主代表来管理工程。
在破产企业的债权中,不必申报,由管理人调查后列出清单并予以公示的包括( )。
企业经营管理者总是希望企业的盈亏平衡点越低越好,盈亏平衡点越低,企业的经营风险就越小。()
2015年1月,乙公司向A法院提起诉讼,要求甲公司偿还自己的装修款50万元,同年3月法院判决甲公司清偿乙公司50万元。同年5月,B法院受理了甲公司破产申请,此时甲仍未向乙公司清偿装修款,则下列说法正确的是()。
全世界迄今为止,年代最久、唯一留存、以无坝引水为特征的宏大水利工程是()。
程序设计流程图中,斜四边形表示的算法功能是()。
最新回复
(
0
)