首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
有如下程序: #include<iostreanl> using namespace std; class MyClass{ public: MyClass(int x):val(x){ } void Set(int x
有如下程序: #include<iostreanl> using namespace std; class MyClass{ public: MyClass(int x):val(x){ } void Set(int x
admin
2012-01-20
63
问题
有如下程序: #include<iostreanl> using namespace std; class MyClass{ public: MyClass(int x):val(x){ } void Set(int x){val=x;} void Print( )eonst{eout<<"val="<<val<<’\t’;} private: int val; }; int main( ){ eonst MyClass objl(10); MyClass obj2(20); objl.Print(); //语句1 obj2.Print( ); //语句2 objl.Set(20); //语句3 obj2.Set(30); //语句4 return 0; } 其主函数中错误的语句是
选项
A、语句1
B、语句2
C、语句3
D、语句4
答案
C
解析
转载请注明原文地址:https://kaotiyun.com/show/3RVp777K
本试题收录于:
二级C题库NCRE全国计算机二级分类
0
二级C
NCRE全国计算机二级
相关试题推荐
下列程序的输出结果是()。#include<stdio.h>voidmain(){inta=0,b=1,c=2;if(++a>0‖++b>0)++c;printf("%d,%d,%d",a,b,c);}
以下叙述中正确的是()。
有以下程序#include<stdio.h>main(){inta=2,b;b=(a>>=1)+4;printf("%d,%d",a,b);}程序运行后的输出结果是
有以下程序#includevoidfun(intx,inty,int*c,int*d){*c=x+y;*d=x-y;}main(){inta=4,b=3,c=0,d=0;fun(a,b,&c
已定义以下函数:intfun(int*p){return*p;}fun函数的返回值是()。
以下叙述中正确的是()。
设有定义:chars[81];inti=0;,以下不能将一行(不超过80个字符)带有空格的字符串正确读入的语句或语句组是( )。
若某二叉树中的所有结点值均大于其左子树上的所有结点值,且小于右子树上的所有结点值,则该二叉树遍历序列中有序的是
在黑盒测试方法中,设计测试用例的主要根据是()。
某系统结构图如下所示(图中n≥5): 该系统结构图的宽度是()。
随机试题
妇产科病机中的核心是
城市规划编制单位弄虚作假骗取资质证书和涂改、转让、出租、出售资质证书的,其编制成果不予审批,责令限期改正,处以()罚款,资质证书作废并收回。
按()分,可将通风系统分为送风和排风。按()分类,可将空调系统分为集中式空调系统、半集中式空调系统及分散式空调系统。
()作为操作风险缓释的有效手段,一直是商业银行管理操作风险的重要工具。
J.Martin的战略化策略从几个方面考虑,下面哪些方面是系统成败的关键?
将专用IP地址转换为公用IP地址的技术是()。
CarThievesCouldBeStoppedRemotelySpeedingoffinastolencar,thethiefthinkshehasgotagreatcatch.Butheisina
ENow,I’dlikeyoutotalkaboutsomethingbetweenyourselves.Youshouldtakecaretosharetheopportunityofspeaking.
Thecrowdwishedthenewly-marriedcouplewellastheyleft______theirhoneymoon.
Theinformationsuperhighwayhas_________solutionstopeople’sneedstocontactothersquicklyandconveniently.
最新回复
(
0
)