首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
有如下类定义: class Box{ public: double GetLength() { return length; } double GetWidth();
有如下类定义: class Box{ public: double GetLength() { return length; } double GetWidth();
admin
2015-06-27
14
问题
有如下类定义:
class Box{
public:
double GetLength() { return length; }
double GetWidth();
double GetHeight();
private:
double length,width,height;
};
inline double Box::GetWidth() { return width; }
double Box::GetHeight() { return height; }
在成员函数 GetLenth、GetWidth 和 GetHeight 中,内联函数有
选项
A、3个
B、2个
C、1个
D、0个
答案
B
解析
在类体中定义的成员函数,C++系统会自动将它们作为内联函数处理,而在类外定义的成员函数,系统并不把它们默认为内联函数,使用inline也是内联函数,所以共有2个内联函数GetLength和GetWidth,B选项正确。
转载请注明原文地址:https://kaotiyun.com/show/U9BD777K
本试题收录于:
二级C题库NCRE全国计算机二级分类
0
二级C
NCRE全国计算机二级
相关试题推荐
下列关于t分布的说法正确的是()
有关教育心理学的研究成果,搭配恰当的一组是()
根据教育作用对象的不同,教育功能可分为
某市政府建新办公大楼,工程由某建筑公司承包。工程按期竣工并验收合格后,市政府由于财政困难,部分工程款一直未按期付给建筑公司,致该公司陷入严重经济困难。建筑公司认为自己的合法权益被侵犯,遂诉至法院。本案中,市政府应负()。
简述我国地方性法规的制定权限。
革命根据地时期,创立管制刑的宪法性文件是
考场有16排座位,第一排有16个座位,以后各排都比前一排多一个座位,如果允许考生任意坐,但不能坐在同一排考生的旁边,则该考场最多能容纳考生()。
一个瓷质容器,内壁和外壁的形状分别为抛物线绕y轴的旋转面,容器的外高为10,比重为。把它铅直地浮在水中,再注入比重为3的溶液。问欲保持容器不沉没,注入液体的最大深度是多少?(长度单位为厘米)
下列选项中不属于结构化程序设计原则的是()。
有下列二又树,对此二叉树前序遍历的结果为().[*]3
随机试题
从理论上讲分离方式一共有()种。
支气管扩张病人的咳嗽特点为()
免疫荧光抗体技术间接法是将荧光素标记在
某毛石砌体挡土墙,其剖面尺寸如图5.7.6所示,墙背直立,排水良好。墙后填土与墙齐高,其表面倾角为β,填土表面的均布荷载为q。按《建筑地基基础设计规范》作答。试问:假定填土采用粉质黏土,其重度为19kN/m3(干密度大于1650kg/m3)
在水平管道上只允许有轴向位移,不允许有横向位移的地方,应设支架为()。
下列场所的消防用电应按二级负荷供电的有()。
长江大学三名大学生为救两名儿童而牺牲,有人认为值得,有人认为不值得。你怎么看?
二维数组A[0…8,0…9]中的每个元素占2个字节,从首地址200开始,按行优先顺序存放,则元素A[5,5]的存储地址为()。
Scientistsgenerallyholdthatlanguagehasbeensolonginusethatthelengthoftimewritingisknowntocoveris______inco
Forthefirsttwo-thirdsofthe20thcentury,chemistrywasseenbymanyasthescienceofthefuture.Thepotentialofchemical
最新回复
(
0
)