网友您好, 请在下方输入框内输入要搜索的题目:
题目内容
(请给出正确答案)
9、对const的使用,以下描述错误的为:
A.可以用const修饰对象、数据成员或成员函数
B.常对象只能调用类的常成员函数
C.常数据成员一经初始化就不能二次赋值
D.常成员函数可以调用该类的非常成员函数
参考答案和解析
D
更多 “9、对const的使用,以下描述错误的为:A.可以用const修饰对象、数据成员或成员函数B.常对象只能调用类的常成员函数C.常数据成员一经初始化就不能二次赋值D.常成员函数可以调用该类的非常成员函数” 相关考题
考题
下列语句中,错误的是______。A.const int buffer=256;B.const double*point;C.int const buffer=256;D.double*const point;
考题
( 18 ) 下列语句中,错误的是A ) const int buffer=256;B ) const double *point;C ) int const buffer=256;D ) double * const point;
考题
下列语句中错误的是( )。A.const int a;B.const int a=10;C.const int*point=0;D.const int*point=new int(10);
考题
在VB中,以下关于符号常量的声明正确的是 ( )A.Const TAG as StringB.Const TAG as String=&qu
在VB中,以下关于符号常量的声明正确的是 ( )A.Const TAG as StringB.Const TAG as String="Visual Basic"C.Public TAG as String="Visual"D.Dim TAG as String
考题
main函数中发生编译错误的语句是______。 include class A { public: int a; const i
main函数中发生编译错误的语句是______。include<iostream.h>class A{public:int a;const int b;A( ):a(10),b(20){}void fun( )const{cout<<"a="<<a<<"\tb="<<b<<endl;}};void main( ){A obj1;const A*ptr=new A;ptr=obj1;ptr->a=100;ptr->fun( );}
考题
关于const常量定义,下面正确的使用方式是()
A.const Pi float64 = 3.14159265358979323846const zero = 0.0B.const (size int64 = 1024eof = -1 )C.const (ERR_ELEM_EXIST error = errors.New("element already exists")ERR_ELEM_NT_EXIST error = errors.New("element not exists"))D.const u, v float32 = 0, 3 const a, b, c = 3, 4, "foo"
考题
要禁止修改指针p本身,又要禁止修改p所指向的数据,这样的指针应定义为( )。
A.const char *p=”ABCD”;B.char const *p=”ABCD”;C.char *const p=”ABCD”;D.const char *const p=”ABCD”;
考题
下列语句中,错误的是( )。A.const int buffer:256;B.const int temp;C.const double*point;D.const double*rt=new double(5.5);
考题
What do the following declarations mean?a) const int a;b) int const a;c) const int *a;d) int * const a;e) int const * a const;
考题
下列语句中,错误的是( )。A.const int buffer=256;B.const double*point;C.int const buffer=256;D.double*eonst point:
考题
对于语句const int x=10;的描述正确的是( )。A.该语句不允许定义为int const x=10;B.在程序中可以重新对X赋值C.变量X不能使用+ +运算符D.const关键字只能用来修饰常量
考题
下列关于const限定符的说法中,错误的是()。A、const限定符是左结合的,即它修饰在它左边的类型B、在说明const变量时,必须对该变量进行初始化C、与宏定义符号常量的区别是,const将产生一个具有类型的符号D、const变量是常量变量,所以一个const变量可以被多次赋予不同的常量
考题
下列语句哪些是错误的语句()A、ConstImaxAsInteger=o155B、Const_GaAsString="abc"C、Dimaa,bbAsInteger,ccAsStringD、yy=8,uu=9
考题
在下列的标识符常量的定义语句中,错误的定义语句是()。A、const double PI=3.14159;B、const int N=20;C、const char ch;D、const bool mark=true;
考题
以下定义常量不正确的语句是()A、Const Num As Integer=200B、Const Num1 As Long=200, Sstr$="World"C、Const Sstr$="World"D、Const Num$=#World#
考题
代码public static const int A=1;中的错误是()A、 A需要定义类型B、 格式错误C、 const不能用static修饰符D、 const不能用public修饰符
考题
以下各项中,不是字符串常量的是()。A、Const a As Single=10.5B、Const a As Double=Cos(10.5)C、Const a="abc"D、Const a As Integer=10.5
考题
单选题下列语句中,错误的是( )。A
const int buffer=256;B
const double*point;C
int const buffer=256;D
double*const point;
考题
单选题代码public static const int A=1;中的错误是()A
A需要定义类型B
格式错误C
const不能用static修饰符D
const不能用public修饰符
热门标签
最新试卷