首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
下列程序的运行结果是 #include<iostream.h> class A { int a; public: A( ) {a=0;} A(int aa) {
下列程序的运行结果是 #include<iostream.h> class A { int a; public: A( ) {a=0;} A(int aa) {
admin
2013-02-27
72
问题
下列程序的运行结果是
#include<iostream.h>
class A
{
int a;
public:
A( ) {a=0;}
A(int aa)
{
a=aa;
cout < < a++;
}
};
void main( )
A x,y(2) ,z(3) ;
cout < < endl;
}
选项
A、00
B、23
C、34
D、25
答案
B
解析
本题考查的是对构造函数的掌握,另外“++”运算符是右结合的,所以在进行输出的时候都是先把原来的输出后再自加1。
转载请注明原文地址:https://kaotiyun.com/show/6lVp777K
本试题收录于:
二级C题库NCRE全国计算机二级分类
0
二级C
NCRE全国计算机二级
相关试题推荐
若有定义:doublea;floatb;shortc;若想把1.2输入给变量a,3.4输入给变量b,5678输入给变量c,程序运行时键盘输入: 1.23.45678<回车> 则以下正确的读入语句是()。
有以下程序 #include<stdio.h> intfun(inta[],intn) { if(n>1) returna[0]+fun(a+1,n-1); else returna[0]; } main()
以下叙述中错误的是()。
有以下程序 #include<stdio.h> voidmain() { doublex=2.0,y; if(x<0.0)Y=0.0; elseif(x<10.0)y=1.0/x; elsey=1.0; prin
有以下程序:#include<stdio.h>#include<string.h>main(){charstr[][20]={"One*world","One*Dream!"),*p=str[1];printf("%d,",strlen(p
已知下列函数定义:fun(int*b,int,c,intn,intdata){intk;for(k=0;k<m*n;k++){*b=data;b++;}}则调用此函数的正确写法是(假设变量a的说明为inta[50])(
面向对象方法中,继承是指()。
常用的连续存储管理技术有固定分区存储管理和()。
关于for循环,不正确的是()。
下面表示纯虚函数的成员函数是()。
随机试题
下列哪一项是企业营销运作环境调查的因素()
患者饱餐后上腹部持续疼痛1天。查体:上腹部压痛、反跳痛。应首先考虑的是()
不同类型沥青混合料采用的级配应不同,ATB-25宜采用()。
将资产分为单项资产和整体资产的标准是按()。
经济发展水平与税收负担的关系是( )。
某镇政府向县建委申请在某大桥桥头修建大楼,应用()行文。
下列叙述中正确的是
YouaregoingtoreadanarticleaboutguidebookstoLondon.Forquestions21-35,choosefromtheguidebooks(A-G).Theguideboo
BelowisalistofestimatesoftheaveragetemperatureriseinChinainthe21stcentury.Lookatitandwriteanessayofabou
ThepollutionquestionaswellasseveralotherissuesisgoingtobediscussedwhentheCongressisin______againnextspring.
最新回复
(
0
)