A
Allamarein
Le't see this dummy subroutine calculating bi-dimensional scalar
product.
I wanna learn to use subroutine and function using arrays like input
+++++++++++++++++++++++
Sub main
dim a(1 to 2), b(1 to 2) as Double
product = dot(a,b)
end main
Function dot(x_vec(),y_vec() as double)
dot=x_vec(1)*y_vec(1)+x_vec(2)*y_vec(2)
end function
+++++++++++++++++++++++
This sub doesn't run: at third line 'a' is not accepted in dot
function.
How should I modify my code?
product.
I wanna learn to use subroutine and function using arrays like input
+++++++++++++++++++++++
Sub main
dim a(1 to 2), b(1 to 2) as Double
product = dot(a,b)
end main
Function dot(x_vec(),y_vec() as double)
dot=x_vec(1)*y_vec(1)+x_vec(2)*y_vec(2)
end function
+++++++++++++++++++++++
This sub doesn't run: at third line 'a' is not accepted in dot
function.
How should I modify my code?