Hey guys,
I am having an issue in working on ruby arrays.
Firstly suppose i have a = [1,2,3] and b [4,5,6] and c=[]
i get an error for this code:-
for i in 0…2
c[i] = a[i]*b[i]
end
saying []= cant be applied to fixnum
Anyways ultimately i solved this error using the << operator
However now i am getting an error :undefined method `^’ for [1]:Array
when i apply
for i in 0…2
c << a[i] ^ b[i]
end
i.e. i am trying to xor values of two arrays and store in a third array
Why the issue and if there is anyway of solving with the first method
itself
Thanks a lot guys
buzz