首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
以下程序的执行结果是( )。 #include<iostream.h> class TestClass2 { public: TestClass2 (){}; TestClass2(int i,int j);
以下程序的执行结果是( )。 #include<iostream.h> class TestClass2 { public: TestClass2 (){}; TestClass2(int i,int j);
admin
2012-01-20
51
问题
以下程序的执行结果是( )。 #include<iostream.h> class TestClass2 { public: TestClass2 (){}; TestClass2(int i,int j); void printb(); private: int a,b; }; class TestClass1 { public: TestClass1(){} TestClass1(int i,int j); void printa(); private: TestClass2 c; }; TestClassl::TestClass1(int i,int j):c(i,j) {} void TestClass1::printa() { c.printb(); } TestClass2::TestClass2(int i,int j) { a=i: b=j; } void TestClass2::printb() { cout<<"a="<<a<<","<<"b="<<b<<endl; } void main() { TestClass1 m(7,9); m.prints(); }
选项
A、a=7,b=8
B、a=8,b=7
C、a=7,b=9
D、a=8,b=9
答案
C
解析
转载请注明原文地址:https://www.kaotiyun.com/show/mCVp777K
本试题收录于:
二级C题库NCRE全国计算机二级分类
0
二级C
NCRE全国计算机二级
相关试题推荐
有以下程序#include<stdio.h>main(){chara[5][10]={"one","two","three","four","five"};inti,j;chart;
有以下程序:#includemin(){inta[]={2,3,5,4},i;for(i=0;i<4;i++)switch(i%2){case0:switch(a[i]%2)
以下关于C语言数据类型使用的叙述中错误的是
下列叙述中正确的是()。
在以下给出的表达式中,与while(E)中的(E)不等价的表达式是()。
若有如下定义:char*ps[]={"aa","bb","CC","dd"}.’则以下叙述中正确的是()。
给定程序MODIl.C中fun函数的功能是:分别统计字符串中大写字母和小写字母的个数。例如,给字符串S输入:AAaaBBb123CCccccd.则应输出结果:upper=6,lower=8。请改正程序中的错误,使它能计算出正确的结果。
支持子程序调用的数据结构是()。
算法空间复杂度的度量方法是
下列模式中,能够给出数据库物理存储结构与物理存取方法的是()。
随机试题
对低值易耗品成新率说法错误的是()
Task2A.logicalandmathematicalskillsB.communicationofyourunderstandingC.successfulapplicationofunderstandingD
在筛查试验中,试验的灵敏度愈高,则
为了截留流入某河道的沿江生活污水,某市拟建一个污水处理厂,包括一套沿江污水收集系统和相应的若干污水提升泵站。拟建污水处理厂项目厂址北侧0.8km处为某居民小区。该污水处理系统工程设计规模定为70万t/d。处理厂分两期建设,一期根据现状污水量确定为30万t/
关于会计凭证的传递,下列表述中,不正确的是()。
仓库按照技术处理方式及保管方式分类,可分为()。
IntenseanddeadlyheatwavehitseasternUSA.
Whatisthepassagemainlyabout?Accordingtoparagraph3,artistswhoworkonpublicartprojectsaredoingallofthefollow
RunningforALongerLife1.Runningmayhelp■protectagainst【T1】_________andotherhealthproblems【T1】_________
Eventhebest-intentionedpoliciescanfallpreytotheoddityofhumanbehavior,asanewstudyofcredit-cardrepaymentfinds.
最新回复
(
0
)