For some things, I preallocate the size and pass this as an argument to create the object, for example v
For others, I define it within the function. Which one is correct?
const num_nutrient = 2
function create_vectors()
v = zeros(num_nutrient)
v::Vector{Float64} = create_v(num_nutrient,v)
end
function create_v(num_nutrient,v)
v[1] = 1.0
v[2] = 0.5
return v
end
Is this the correct way?