请从下列程序中选出存在错误的行代码( )。[br][/br] const double PI=3.1415926;——L1 const int MONTH_IN_YEAR=12;——L2 const double MY_VALUE=3*PI;——L3 int i=1; ——L4 const int CONST_I=i+10; ——L5 A: L1 B: L2 C: L3 D: L4 E: L5
请从下列程序中选出存在错误的行代码( )。[br][/br] const double PI=3.1415926;——L1 const int MONTH_IN_YEAR=12;——L2 const double MY_VALUE=3*PI;——L3 int i=1; ——L4 const int CONST_I=i+10; ——L5 A: L1 B: L2 C: L3 D: L4 E: L5
定义q为一个指向int类型的变量i的常指针语句( )。 A: int * const q=i; B: int * const q=&i; C: const int *q=i; D: const int *q=&i;
定义q为一个指向int类型的变量i的常指针语句( )。 A: int * const q=i; B: int * const q=&i; C: const int *q=i; D: const int *q=&i;
如有定义const int i=5; const int j=3; const int *p=&i; 则执行语句p=&j; 是合法的。
如有定义const int i=5; const int j=3; const int *p=&i; 则执行语句p=&j; 是合法的。
解释下列5个定义的含义,指出其中哪些定义是非法的:(a)int i;(b)const int ic;(c)const int*pic;(d)int*const cpi;(e)const int*const cpic;
解释下列5个定义的含义,指出其中哪些定义是非法的:(a)int i;(b)const int ic;(c)const int*pic;(d)int*const cpi;(e)const int*const cpic;
有如下程序: Const N=-5 Const M=6 Dim a(N To M)As Integer For i=LBound(a)To UBound(a) a(i)= i Next i Print a(LBound(a));a(UBound(a)) 运行后,输出结果为( )。
有如下程序: Const N=-5 Const M=6 Dim a(N To M)As Integer For i=LBound(a)To UBound(a) a(i)= i Next i Print a(LBound(a));a(UBound(a)) 运行后,输出结果为( )。
分析下列程序,指出该程序中定义了几种常类型量。 #include class C { public: C(int i) { p=i; } int getp() { return p; } const int fun(int i)const { return p+i; } private: int p; }; void main() { C a(4); const int b=a.fun(6); int c=a.getp(); cout
分析下列程序,指出该程序中定义了几种常类型量。 #include class C { public: C(int i) { p=i; } int getp() { return p; } const int fun(int i)const { return p+i; } private: int p; }; void main() { C a(4); const int b=a.fun(6); int c=a.getp(); cout
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;
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;
【单选题】In the following description of a const member, the error is (). (2.0分) A. Const members are specified with the keyword const B. There are two types of const member: const data member and const member function C. The initialization of a const data member occurs when it is defined in the class body D. The value of a const data member cannot be changed
【单选题】In the following description of a const member, the error is (). (2.0分) A. Const members are specified with the keyword const B. There are two types of const member: const data member and const member function C. The initialization of a const data member occurs when it is defined in the class body D. The value of a const data member cannot be changed
this指针既可以是指向const对象的非const指针,也可以是指向非const对象的const指针
this指针既可以是指向const对象的非const指针,也可以是指向非const对象的const指针
下面几组代码正确的是 A: const int a; B: const int a; a=1; C: const int a=1; D: int const a=1;
下面几组代码正确的是 A: const int a; B: const int a; a=1; C: const int a=1; D: int const a=1;