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;


相关考题:

下列语句中,错误的是______。A.const int buffer=256;B.const double*point;C.int const buffer=256;D.double*const point;

下列的符号常变量定义中,错误的定义是()。 A.const M=10;B.const int M=20;C.const char ch;D.const bool mark=true;

下列语句中,错误的是 brA . const int buffer=256; brB . const int temp;brC . const double *point ; brD . const double *rt =new double(5.5);br

有如下类定义:class AA{int a;public:int getRef() const{return a;} // ①int getvalue() const{return a;} // ②void set(int n) const{a=n;} // ③friend void show(AA aa) const {cout // ④};其中的四个函数定义中正确的是A . ①B . ②C . ③D . ④

有如下类定义:class Test{public:Test(){ a = 0; c = 0;} // ①int f(int a)const{this-a = a;} // ②static int g(){return a;} // ③void h(intB . {Test::b = b;}; // ④private:int a;static int b;const int c;};int Test::b = 0;在标注号码的行中,能被正确编译的是A . ①B . ②C . ③D . ④

( 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);

( 28 )有如下程序:#includeiostreamusing namespace std;class MyClass{public:MyClass(int x):val(x) {}void Print() const {cout"const:val="val'\t';}void Print(){cout"val="val't';}private:int val;};int main(){const MyClass obj1(10);MyClass obj2(20);obj1.Print();obj2.Print();return 0;}程序的输出结果是A ) val=10 const:val=20B ) const:val=10 const:val=20C ) const:val=10 val=20D ) val=10 val=20

有如下程序:includeusing namespace std;class MyClass{public:MyClass(int x):val(x 有如下程序: #include<iostream> using namespace std; class MyClass{ public: MyClass(int x):val(x){} void Print()const{cout<<“const:val=”<<<val<<‘\’;} void Print(){cout<<“val=”<<val<<‘t’;} private: int va1; }; int main(){ consA.val=10 const:val=20B.const:val=10 const:val=20C.const:val=10 val=20D.val=10 val=20

下列的符号常量定义中,错误的定义是( )。A、const M=10;B、const int M=20;C、const char ch;D、const bool mark=true;

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( );}

有如下类定义: class AA { int a; public: int getRef()const{ return a; } //① int getValue()const{ return a; } //② void set(int n)const{ a=n; } //③ friend void show(AA aa)const{ cout<<a; } //④ }; 其中的四个函数定义中正确的是( )。A.①B.②C.③D.④

下列语句中,错误的是( )。A.const int buffer:256;B.const int temp;C.const double*point;D.const double*rt=new double(5.5);

下列一维数组定义正确的是( )。A.x=5;int num[x];B.const iht x=5;float num[x];C.const float x=5;int num[x];D.const int x;x=5;intnum[x];

设int x:,则经过______ 后,语句*px=0;可将x值置为0。A.int*px;B.int const *px=x;C.int* const px=x:D.const int *px=x;

有如下类定义: class Test { public: Test(){a=0;c=0} //① int f(int a)const{this->a=a;} //② static int g(){return a;} //③ void h(int b){Test::b;}; //④ private: int a; static int b; const int C; }; int Test::b=0; 在标注号码的行中,能被正确编译的是( )。A.①B.②C.③D.④

下列语句中,错误的是( )。A.const int buffer=256;B.const double*point;C.int const buffer=256;D.double*eonst point:

有如下类定义: class Test { public: Test(){a=0;c=0;} //① int f(int a)const {this->a=a;} //② static int g(){return a;} //③ void h(int b){Test::b=b;}; //④ private: int a; static int b; const int c; }; int Test::b=0; 在标注号码的行中,能被正确编译的是A.①B.②C.③D.④

有如下程序:includeusing namespace std;class MyClass{public: MyClass(int x):val( 有如下程序: #include<iostream> using namespace std; class MyClass{ public: MyClass(int x):val(x) {} void Print() const {cout<<"const:val="<<val<<'\t';} void Print() {cout<<"val="<<val<<'t';} private: int val; }; int main() const MyClass obj1(10); MyClass obi2(20); obj1.Print(); obj2.Print(); return 0; } 程序的输出结果是( )。A.val=10 const:val=20B.const:val=10 const:val=20C.const:val=10 val=20D.val=10 val=20

下面的语句中错误的是( )。A.int a=5;int x[a];B.const int a=5;int x[a];C.int n=5;int *p=new int[n];D.const int n=5;int *p=new int[a];

有下列程序:includeusing namespace std;class VAC{public: int f() const{return3;} 有下列程序: #include<iostream> using namespace std; class VAC{ public: int f() const{return3;} int f() {return 5;} }; int main(){ VAC v1; const VAC v2; cout<<v1.f()<<v2.f();A.53B.35C.55D.33

有如下程序: #inCludeiostream using namespaCe std; Class MyClass{ publiC: MyClass(int X):val(X){} void PrintConst}tout”Const:val=”val’\t’;} void Print{tout”val=”val’\t’;} private: int val; }; int main{ Const MyClass objl(10); MyClass obj2(20); objl.Print; obj2.Print; retum 0; } 执行这个程序的输出结果是( )。A.val=10 Const:val=20B.Const:val=10 Const:val=20C.Const:val=10 val=20D.val=10 val=20

下列定义中p指向的地址可更改,但*p不能够更改的是A.const int *p;B.int * const p;C.const int *const p;D.int *p;

下面的语句中错误的是A.int a = 5; int x[a];B.const int a = 5; int x[a];C.int n = 5; int *p = new int [a];D.const int n = 5; int *p = new int [a];

在下列的标识符常量的定义语句中,错误的定义语句是()。A、const double PI=3.14159;B、const int N=20;C、const char ch;D、const bool mark=true;

若有类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;}

单选题若有类W说明class W{int a;public:voidfConst(int)const;};,则函数fConst的正确定义是()Avoid W::fConst(intk)const{k=a;}Bvoid W::fConst(intk)const{k=a++;}Cvoid W::fConst(intk)const{cina;}Dvoid W::fConst(intk)const{a=k;}