首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
有如下程序: #include<lostreanl> using namespace std; elass MyClass{ public: MyClass( ){++count;} ~MyClass( ){--coun
有如下程序: #include<lostreanl> using namespace std; elass MyClass{ public: MyClass( ){++count;} ~MyClass( ){--coun
admin
2012-01-20
64
问题
有如下程序: #include<lostreanl> using namespace std; elass MyClass{ public: MyClass( ){++count;} ~MyClass( ){--count;} static int getCount( ){return count;} private: static int count; }; int MyClass::count=0; int main( ){ MyClass obj; cout<<obj.getCount( ); MyClass*ptr=new MyClass; cout<<MyClass::getCount( ); delete ptr; cout<<MyCiass::getCount( ); return 0; } 程序的输出结果是
选项
A、121
B、232
C、221
D、122
答案
A
解析
转载请注明原文地址:https://www.kaotiyun.com/show/lPVp777K
本试题收录于:
二级C题库NCRE全国计算机二级分类
0
二级C
NCRE全国计算机二级
相关试题推荐
有以下程序#includemain(){inty=9;for(;y>0;y--)if(y%3==0)printf("%d",--y);}程序的运行结果是()。
有以下程序:#incdude<stdio.h>structS{intn;inta[20];{;wildf(structS*p){inti,j,t;for{i=0;i<p->n-1;i++)for(j=i+1;j<p->n;j++)
下面是有关C语言字符数组的描述,其中错误的是()。
有以下程序#include<stdio.h>main(){intc,d;c=(13>>1)|1;d=(13>1)||1;printf("%d,%d\n",c,d);}程序运行后的输出结果
有以下程序#include<stdio.h>main(){inta[10]={1,3,5,7,11,13,17},*p=a;printf("%d,",*(p++));printf("%d\n",*
以下叙述中正确的是()。
关系模型允许定义3类数据约束,下列不属于数据约束的是()。
下列叙述中正确的是
若函数调用时的实参为变量,以下关于函数形参和实参的叙述中正确的是()。
关于C语言的符号常量,下列叙述正确的是()。
随机试题
爱国主义最基本的内容是【】
患者男性,70岁,平日BPl50/60mmHg,脉压增大的原因可能是由于
A.周围神经炎B.精神兴奋、血清转氨酶增高C.眼泪及汗液呈粉红色D.耳聋E.视野缺损用利福平可出现
关于工程项目人力资源管理的一般过程的表述中错误的一项是()。
如何看待“干部出数字、数字出干部”现象?
知识营销是指在企业的营销过程中,使企业的广告、宣传、公关、产品注入一定的知识含量与文化内蕴,帮助消费者增加与商品相关并实用的信息与知识,提高他们的消费与生活质量,从而达到推广产品、树立形象、提升品牌竞争力的目的。根据上述定义,下列属于知识营销的是(
佛朗西斯·克里克提出的中心法则指明了遗传信息的流向,在科学发展中得到不断补充完善。根据该法则,下列哪一种遗传信息传递流程不可能发生?
下面程序的运行结果是______。typedefunionstudent{charname[10];longsno;charsex;floatscore[4];}STU;
•Youwillhearfiveshortpieces.•Foreachpiecedecidewhichtypeofbusinesseachspeakeristalkingabout.Writeoneletter
•Readthearticlebelowaboutcreditinbusiness.•Choosethebestwordtofilleachgap,fromA,B,CorD.•Foreachquestion
最新回复
(
0
)