单项选择题

下面的语句中错误的是

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];
<上一题 目录 下一题>
热门 试题

单项选择题
下面程序的结果是#includeclass A{int a;public:A():a (1){}void showa(){cout<<a;}};class B{int a;public:B():a (2){}void showa(){cout<<a;}};class C:public A, public B{int a;public:C():a (3){}void showa(){cout<<a;}};void main(){C c;c.showa();}
A.1
B.2
C.3
D.程序有错误
单项选择题
下列定义中p指向的地址可更改,但*p不能够更改的是
A.const int *p;
B.int * const p;
C.const int * const p;
D.int *p;
相关试题
  • 若要在C盘根目录下作为二进制文件打开文件t...
  • 以下程序的输出结果是______。#incl...
  • ______是实现C++语言编译时多态性...
  • 关系表达式0<20为真,所以表达式!a。
  • 表达式x.operator++()还可写成___...