问题
单项选择题
单击命令按钮时,下列程序的执行结果是( )。 Private Sub Command1_Click() Dim a As Integer,b As Integer,c As Integer a=3 b=4 c=5 Print SecProc(c,b,a) End Sub Function FirProC(x As Integer,y As Integer,z As Integer) FirProc=2*s+y+3*z End Function Function SecProc(x As Integer,y As Integer,z As Integer) SecProc=FirProc(z,x,y)+x End Function
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
解析:数组元素一般形式为x(整数),这是对于一维数组而言的;对于二维数 组,只要在圆括号中多加两个整数就可以了,两个整数之间用逗号隔开,其形式为x(整数 1,整数2),其中整数1代表二维数组的行数,整数2代表二维数组的列数。所以正确答 案是选项B)。