首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
有如下类定义: class Bag{ public: Bag(string s,string cr); //① ~Bag(); //②
有如下类定义: class Bag{ public: Bag(string s,string cr); //① ~Bag(); //②
admin
2021-02-22
14
问题
有如下类定义:
class Bag{
public:
Bag(string s,string cr); //①
~Bag(); //②
string GetSize(); //③
static int GetCount(); //④
private:
string size,color;
static int count;
};
在标注号码的4个函数中,不具有隐含this指针的是
选项
A、①
B、②
C、③
D、④
答案
D
解析
当在类的非静态成员函数中访问类的非静态成员的时候,编译器会自动将对象本身的地址作为一个隐含参数传递给函数,所以①②③正确使用this指针。而④为静态成员,没有this指针,答案为D选项。
转载请注明原文地址:https://jikaoti.com/ti/zqh0FFFM
本试题收录于:
二级C题库NCRE全国计算机二级分类
0
二级C
NCRE全国计算机二级
相关试题推荐
下列语句分别是不同程序中的第一个输入输出语句,若去掉其中的“
数据库管理系统中负责数据模式定义的语言是
下列关于基类和派生类关系的叙述中,正确的是()。
以下程序的输出结果是()。main(){inta=4,b=5,c=0,d;d=!a&&!b‖!C;cout
请打开考生文件夹下的解决方案文件proj3,其中声明了ValArray类,该类在内部维护一个动态分配的整型数组。ValArray类的复制构造函数应实现对象的深层复制。请编写ValArray类的复制构造函数。在main函数中给出了一组测试数据,此种情况下程序
使用VC6打开考生文件夹下的源程序文件modi3.cpp。其中定义的类并不完整,按要求完成下列操作,将类的定义补充完整。完成以下功能:(1)完成构造函数的定义,使得数据成员变量filename和contex为空,内容长度FileLength为0。
已知Value是一个类,Value是Value的一个对象。下列以非成员函数形式重载的运算符函数原形中,正确的是()。
下列关于运算符重载的叙述中,正确的是()。
一间宿舍可住多个学生,则实体宿舍和学生之间的联系是()。
在E-R图中,用来表示实体联系的图形是( )。
随机试题
Peopletodayarestilltalkingaboutthegenerationgap(代沟).Someparentscomplainthattheirchildrendonotshowthemproperr
《拆迁管理条例》规定,拆迁人与被拆迁人应当依照本条例的规定,就补偿安置、搬迁期限等事项签订拆迁补偿安置协议。拆迁人应当在拆迁补偿安置协议订立之日起()日内到房屋拆迁主管部门办理备案手续。
由银行作为出票人签发,银行在见票时按照实际结算金额无条件支付给收款人或者持票人的票据是()。
按照惯例,北华工商管理学院每年一度的特等奖学金获得者的名额仅3名,奖金数额高达10000元。1998年,该校董事会关于评定本年度特等奖学金确定了如下的原则:只有连续3年获得过三等奖以上的奖学金并且本年度各门学科终考成绩平均得分在90分以上的,方可获该项特等
宋之鄙人得璞玉献之子罕,子罕不受。鄙人曰:“此宝也,宜为君子器,不宜为细人用。”子罕曰:“尔以玉为宝,我以不受子之玉为宝。”上述材料说明()。
学生害怕在社交场合讲话,担心自己会因发抖,脸红,声音发颤,口吃而暴露自己的焦虑,觉得自己说话不自然,因而不敢抬头,不敢正视对方眼睛,这种心理状态是一种()。
政府进行需求管理的政策工具主要是()。
在一个口袋中有10个黑球、6个白球、4个红球,至少从中取出多少个球才能保证其中有白球?
实际上雾霾形成的原因是多方面的,识别污染源是有效治理大气污染至关重要的环节。对京津冀区域而言,认清区域内污染源的共性及差别,有助于区域内地区_________地对污染源进行综合治理。填入画横线部分最恰当的一项是:
某学校初中二年级五班的物理老师要求学生两人一组制作一份物理课件。小曾与小张自愿组合,他们制作完成的第一章后三节内容见文档“第3-5节.pptx”,前两节内容存放在文档“第1-2节.pptx”中。小张需要按下列要求完成课件的整合制作:将演示文稿“第3-5
最新回复
(
0
)