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

admin2017-11-27  25

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

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

答案B

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

最新回复(0)