已知数组Dim a(1To10)As Integer,则下面正确调用GetValue函数的是( )。 Private Function GetValue(a()As Integer) As Integer For i=1To10 GetValue=G

admin2020-06-30  30

问题 已知数组Dim a(1To10)As Integer,则下面正确调用GetValue函数的是(    )。
Private Function GetValue(a()As Integer)
As Integer
For i=1To10
GetValue=GetValue+a(i)
Next i
End End Function

选项 A、S=GetValue(a(1To10))
B、S=GetValue(a)
C、S=GetValue(a(10))
D、S=GetValue a

答案B

解析 本题考查数组作为函数参数的调用。数组作为函数参数只能进行地址传递。需要注意的是在形参数组中可以忽略维数的定义,但是不能省略圆括号,实参数组名后面可以不跟圆括号。
转载请注明原文地址:https://kaotiyun.com/show/jmHp777K
0

最新回复(0)