问题
单项选择题
以下有关数组定义的语句序列中,错误的是______。
A.Static arrl(3)
arrl(1)=100
arrl(2)="Hello"
arrl(3)=123.45
B.Dim arr2()As Integer
Dim size As Integer
Private Sub Command2 Click()
size=InputBox("输入:")
ReDimarr2(size)
End Sub
C.Option Basel
Private Sub Command3 Click()
Dim arr3(3)As Integer
End Sub
D.Dim n As Integer
Private Sub Command4 Click()
Dim arr4(n) As Integer
End Sub
答案
参考答案:D
解析:[评析] 在数组定义中,定义的数组元素个数不能是变量。而选项D中的n是一个变量。