首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
根据下列程序的执行结果,可以断定划线部分的修饰符应为【 】。 执行结果: i9a football is created. a football is created. i=10 a football is destroyed. a football is
根据下列程序的执行结果,可以断定划线部分的修饰符应为【 】。 执行结果: i9a football is created. a football is created. i=10 a football is destroyed. a football is
admin
2010-06-06
37
问题
根据下列程序的执行结果,可以断定划线部分的修饰符应为【 】。
执行结果:
i9a football is created.
a football is created.
i=10
a football is destroyed.
a football is created.
i=20
a football is destroyed.
a football is destroyed.
源程序:
# inelude<iostream. h>
class Football
{
public:
Football() {cout<<"a football is created. "<<end1; }
~Football() {cout<<"a football is destroyed. "<<end1;
};
void func(int i)
{
______ Football f1;
Football f2;
cout<<"i= "<<i<<end1;
}
void main()
{
func(10);
func(20);
}
选项
答案
static
解析
观察一下输出中对象的构造函数和析构函数的执行次数可以看出,再次进入时某对行没有被构造,亦即该对象在func执行后没有被销毁,再次进入时则不需要重构,可以体现这种功能的标识符只有static。
转载请注明原文地址:https://jikaoti.com/ti/59W0FFFM
本试题收录于:
二级C题库NCRE全国计算机二级分类
0
二级C
NCRE全国计算机二级
相关试题推荐
给定程序MODI1.C中函数fun的功能是:判断ch中的字符是否与str所指串中的某个字符相同;若相同,什么也不做,若不同,则将其插在串的最后。请改正程序中的错误,使它能进行正确的操作。注意:不要改动main函数,不得增行或删行,也不
有三个关系R、S和T如下:则由关系R和s得到关系T的操作是()。
设q1和q2是指向一个int型一维数组的指针变量,k为float型变量,下列不能正确执行的语句是()。
将E-R图转换到关系模式时,实体与联系都可以表示成()。
若已定义的函数有返回值,则以下关于该函数调用的叙述中错误的是()。
请编写函数fun,该函数的功能是:删除一维数组中所有相同的数,使之只剩一个。数组中的数已按由小到大的顺序排列,函数返回删除后数组中数据的个数。例如,若一维数组中的数据是:22234456666778991
有三个关系R和S如下:则由关系R得到关系S的操作是
若变量已正确定义为int型,要通过语句scanf("%d,%d,%d",&a,&b,&c);给a赋值1、给b赋值2、给c赋值3,以下输入形式中错误的是(注:□代表一个空格符)
算法的空间复杂度是指()。
对于派生类的构造函数,在定义对象时构造函数的执行顺序为:先执行【】。再执行成员对象的构造函数,后执行派生类本身的构造函数。
随机试题
绞吸挖泥船开挖淤泥类土的分层挖泥厚度宜为绞刀直径的()。
被称为“阳脉之海”的经脉是()
肾病综合征最常见的临床症状是
下列关于期货公司首席风险官报告义务的表述,正确的有()。
跨商品套利可分为两种情况,一是相关商品间的套利,二是原料与成品间的套利,下列交易活动中属于跨商品套利的有()。
下列各项,属于衍生金融工具的有()。
商店卖气枪子弹,每粒1分钱,每5粒4分钱,每10粒7分钱,每20粒1角2分钱。小明的钱至多能买73粒,小刚的钱至多能买87粒,小明和小刚的钱合起来能买多少粒?
左图为给定的多面体,从任一角度观看,下面哪一项不可能是该多面体的视图?
已知下列非齐次线性方程组:求解方程组(I),用其导出组的基础解系表示其通解;
WhatdotheHoffmansdoforaliving?
最新回复
(
0
)