函数参数不能限定数组元素的个数,参数仅仅是说明了参数类型是元素为double型的数组。
以下代码只保留数组的前五个元素的值,能起到限定数组长度的作用。Public Sub test(a() As Double, b() As Double) dim c(5) as double dim d(5) as double dim i as integer for i = 0 to 4 c(i)=a(i) d(i)=b(i) next d(0) = c(0) + 2: d(1) = c(1) + 3 End Sub