首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
根据下列程序的执行结果,可以断定划线部分的修饰符应为______。执行结果: i9a football is created. a football is created. i=10 a football is destroyed.
根据下列程序的执行结果,可以断定划线部分的修饰符应为______。执行结果: i9a football is created. a football is created. i=10 a football is destroyed.
admin
2010-12-16
24
问题
根据下列程序的执行结果,可以断定划线部分的修饰符应为______。执行结果:
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.
源程序:
#include<iostream.h>
class Football
{
public:
Football( ){cout<<"a football is created."<<endl;}
~Football( ){tout<<"a football is destroyed."<<endl;}
};
void func(int i)
{
______Football f1;
Football f2;
cout<<"i="<<i<<endl;
}
void main( )
{
func(10);
func(20);
}
选项
答案
static
解析
观察一下输出中对象的构造函数和析构函数的执行次数可以看出,再次进入时某对象没有被构造,亦即该对象在func执行后没有被销毁,再次进入时则不需要重构,可以体现这种功能的标识符只有static。
转载请注明原文地址:https://jikaoti.com/ti/AJL0FFFM
本试题收录于:
二级C题库NCRE全国计算机二级分类
0
二级C
NCRE全国计算机二级
相关试题推荐
下列定义变量的语句中错误的是()。
数据结构中,与所使用的计算机无关的是数据的()。
以下程序:#include<stdio.h>main(){charstr[10];scanf("%s",&str);printf("%s\n",str);}运行上面的程序,输
在软件开发中,需求分析阶段产生的主要文档是()。
在软件开发中,需求分析阶段产生的主要文档是()。
有三个关系R、S和T如下:则由关系R和S得到关系T的操作是()。
下列给定程序中函数fun的功能是:将P所指字符串中的所有字符复制到b中,要求每复制三个字符之后插入一个空格。例如,若给a输入字符串:ABCDEFGKHIJK,调用函数后,字符数组b中的内容为:ABCDEFGHIJK。请改正程序中的错误,使它能得出
某二叉树共有150个结点,其中有50个度为1的结点,则()。
软件测试的目的是()。
虚基类说明格式如下:slass派生类名【】<继承方式><基类名>。
随机试题
Anumberofpersonalcharacteristicsplayavitalroleinthedevelopmentofone’sintelligence.Butpeoplefailtorealizethe
有眼眶血管进出的鼻旁窦是
二次型可以由正交变换化作标准型,下列选项中正确的标准型为()。
《工程咨询成果质量评价办法》中规定,工业项目可行性研究报告质量标准中,对贯彻宏观调控政策情况进行综合评价,不包括对()进行论证。
建设工程项目职业健康安全管理的目的是控制影响工作场所内()健康和安全的条件和因素。
下列各项属于发票的开具要求的有()。
债券凸性对于投资者是不利的,在其他情况相同时,投资者应当选择凸性较小的债券进行投资。()
在贷款五级分类中,下列()属于不良资产。
简述《陕甘宁边区施政纲领》的主要内容和意义。
Whodoesn’tlovebeinginlove?Atruelovelistenstoyoutalkaboutwork,letsyouhavethatlast【C1】______ofpie,andusuall
最新回复
(
0
)