首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
有如下类定义: class Sample{ public; Sample(int x):ref(x){} ∥① private: Sample():ref(0){} ∥② static int
有如下类定义: class Sample{ public; Sample(int x):ref(x){} ∥① private: Sample():ref(0){} ∥② static int
admin
2020-04-07
26
问题
有如下类定义:
class Sample{
public;
Sample(int x):ref(x){} ∥①
private:
Sample():ref(0){} ∥②
static int val=5; ∥③
const int ref; ∥④
};
上述程序段中,错误的语句是( )。
选项
A、①
B、②
C、③
D、④
答案
C
解析
静态整型数据不能定义为类的数据成员。
转载请注明原文地址:https://kaotiyun.com/show/WR8p777K
本试题收录于:
二级C题库NCRE全国计算机二级分类
0
二级C
NCRE全国计算机二级
相关试题推荐
有以下程序:#include<iostream.h>#include<iomanip.h>void main(){cout.fill(’*’);cout.width(10);cout,<s
若有定义语句:intx=3,y=2,z=1;,则表达式x
数据流图的类型有【】和事务型。
下列关于队列的叙述中,不正确的是()。
完全不考虑程序的内部结构和内部特征,而只是根据程序功能导出测试用例的测试方法是()。
以下程序的执行结果是【】。#include<iostream.h>voidmain(){cout.fill(’*’);cout.width(10);cout<<123.45<<endl;cout
下列数据结构中能应用二分查找的是
下列关于栈的叙述正确的是
一棵二叉树共有47个结点,其中有23个度为2的结点。假设根结点在第1层,则该二叉树的深度为【1】。
下面关于算法的叙述中,正确的是()。
随机试题
对于函数以下结论中正确的是().
含有罂粟壳的处方应保留的时间是
阿米巴痢疾在疫情管理上属何类传染病
I/I0指
确诊肺结核最重要的依据为
根据市场供求状况和商品特点,对某些类别的商品实行专营或者专卖的调控手段,属于商品流通宏观经济手段的()手段。
普桑的艺术素养决定了他选择一些具有“__________”的绘画题材,他画的人物也是按照__________、__________的雕刻形象塑造的。
贤士隐居者士子修己笃学,独善其身,不求知于人,人亦莫能知者,所至或有之,予每惜其无传。比得《上虞李孟传》录示四事,故谨书之。其一日,慈溪蒋季庄,当宣和间,鄙王氏①之学,不事科举,闭门穷经,不妄与人接。高抑崇居明州城中,率一岁四五访其庐。
A、 B、 C、 B
Lightningcausesmorefiredamageofforestsandpropertythananythingelse.Moreimportantly,itkillsmorepeoplethananyot
最新回复
(
0
)