网友您好, 请在下方输入框内输入要搜索的题目:
题目内容
(请给出正确答案)
Const One&=1,则One为()类型的常数。
- A、整型
- B、字节型
- C、长整型
- D、单精度型
参考答案
更多 “Const One=1,则One为()类型的常数。A、整型B、字节型C、长整型D、单精度型” 相关考题
考题
假定MyClas为一个类,则该类的拷贝构造函数的声明语句为( )。A.MyClas(MyClas x);B.const MyClas(MyClas x);C.MyClas(const MyClas x);D.MyClas(MyClas x);
考题
某类中有一个无参且无返回值的常成员函数Show,则正确的Show函数原型是A.const void Show();B.void const Show();C.void Show()const;D.void Show(const);
考题
设int x:,则经过______ 后,语句*px=0;可将x值置为0。A.int*px;B.int const *px=x;C.int* const px=x:D.const int *px=x;
考题
有如下程序:includeusing namespace std;class Publication{//出版物类char name[30]
有如下程序: #include<iostream> using namespace std; class Publication{//出版物类 char name[30]; public: Publication(char*name="未知名称"){strcpy(this->name,name);} const char*getName( )const{return name;} //常数据成员 virtual const char*getType( )const{return"未知类型";}//虚常数据成员 }; class Book:public Publication{ //书类 public: Book(char*name):Publication(name){ } virtual const char*getType( )const{return"书";} //虚常数据成员 }; void showPublication(Publication p){cout<<p.getType( )<<":"<<P.getName( )<<endl;} int main( ){ Book book("精彩人生"); showPublication(book); return 0; } 程序的输出结果是A.未知类型:未知名称B.未知类型:精彩人生C.书:未知名称D.书:精彩人生
考题
int型public成员变量MAX_LENGTH,该值保持为常数100,则定义这个变量的语句是( )。A.public int MAX_LENGTH=1 00B.final int MAX_LENGTH=100C.public const int MAX_LENGTH=100D.public final int MAX_LENGTH=100
考题
定义如下枚举类型:enum Number{one=1,two=2,four=4,eight=8},则枚举类型Number的取值范围是( )。A.1~8B.0~8C.1~15D.0~15
考题
下列属于定义VB常量的语句是()。A、Dim常量名[As数据类型]=表达式B、Function常量名As数据类型C、Const常量名[As数据类型]=表达式D、Const常量名[As数据类型]
考题
下列关于const限定符的说法中,错误的是()。A、const限定符是左结合的,即它修饰在它左边的类型B、在说明const变量时,必须对该变量进行初始化C、与宏定义符号常量的区别是,const将产生一个具有类型的符号D、const变量是常量变量,所以一个const变量可以被多次赋予不同的常量
考题
下列符号常量的声明中,()是不合法的。A、Const a As Single = 1.1B、Const a As Integer = “12”C、Const a As Double = Sin(1)D、Const a =”OK”
考题
int型public成员变量MAX_LENGTH,该值保持为常数100,则定义这个变量的语句是()A、public int MAX_LENGTH=100B、final int MAX_LENGTH=100C、public const int MAX_LENGTH=100D、public final int MAX_LENGTH=100
考题
代码public static const int A=1;中的错误是()A、 A需要定义类型B、 格式错误C、 const不能用static修饰符D、 const不能用public修饰符
考题
若有类W说明class W{int a;public:voidfConst(int)const;};,则函数fConst的正确定义是()A、void W::fConst(intk)const{k=a;}B、void W::fConst(intk)const{k=a++;}C、void W::fConst(intk)const{cina;}D、void W::fConst(intk)const{a=k;}
考题
单选题代码public static const int A=1;中的错误是()A
A需要定义类型B
格式错误C
const不能用static修饰符D
const不能用public修饰符
考题
单选题Const One=1,则One为()类型的常数。A
整型B
字节型C
长整型D
单精度型
热门标签
最新试卷