首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
有如下程序: #include using namespace std; class Music{ public: void setTitle(char*str){strcpy(title,str);) pr
有如下程序: #include using namespace std; class Music{ public: void setTitle(char*str){strcpy(title,str);) pr
admin
2020-04-07
60
问题
有如下程序:
#include
using namespace std;
class Music{
public:
void setTitle(char*str){strcpy(title,str);)
protected:
char type[10];
private:
char title[20];
);
class Jazz:public Music{
public:
void set(char*str){
strcpy(type,"Jazz");∥①
strcpy(title,str);∥②
)
);
下列叙述中正确的是( )。
选项
A、程序编译正确
B、程序编译时语句①出错
C、程序编译时语句②出错
D、程序编译时语句①和②都出错
答案
C
解析
派生类Jazz不能访问基类Music中的私有成员title。
转载请注明原文地址:https://kaotiyun.com/show/r38p777K
本试题收录于:
二级C题库NCRE全国计算机二级分类
0
二级C
NCRE全国计算机二级
相关试题推荐
以下程序的执行结果是_____。#include<iostream.h>#include<iomanip.h>voidmain(){cout.fill(’*’);cout.width(10);
请在下列程序中的横线处填写正确的语句:classSample{public:Sample()()~Sample(){}voidSetData(intdata){//将Sample类
Jackson结构化程序设计方法是英国的M.Jackson提出的,它是一种面向【】的设计方法。
继承与【】机制,是面向对象程序中实现重用的主要手段。
下面程序的结果为()。#include"iostream.h"voidchange(inta,intb){inttemp;temp=a;a=b;b=temp:}voi
若有以下程序:#include<iostream>usingnamespacesstd;classA{public:A(){}A(inti){
下列有关类继承的叙述中,错误的是()。
下列关于队列的叙述中,正确的是()。
完全不考虑程序的内部结构和内部特征,而只是根据程序功能导出测试用例的测试方法是
关系数据模型由关系数据结构、关系操作集合和【】三大要素组成。
随机试题
触诊肱动脉搏动的部位是
关于喷雾剂的叙述中正确的是()
敌百虫中毒时禁用碱性药物洗胃主要是为了防止
在臂丛神经阻滞中,哪种方法最不会引起气胸?()
下列各项资产中,在其持有期间内可以通过损益转回已计提的减值准备的有()。
艺术鉴赏
Asthebanksterphenomenonhassoeloquentlyillustrated,Homosapiensisexquisitelysensitivetoinjustice.【F1】Manypeoplegru
Whatdoesthemanwanttodo?
Mostofthepeoplewhoappearmostoftenandmostgloriouslyinthehistorybooksaregreatconquerorsandgeneralsandsoldiers
A、Hecannotdoanythingbecauseheisn’ttheownerofthatzone.B、Hehasdiscussedthiswiththelandowners,butinvain.C、He
最新回复
(
0
)