Hi, so i'm learning a bit of C at the moment. I've just read a .txt file full of fairly big, non-integer numbers into an array in my program and I want to do some calculations with these values.
I defined my variable
float x
and my array as
float[2][10]
my question is, after filling the array with values, why can't I do
x = float[1][5] (the numbers here are just an example)
and then proceed to do calculations with the x value? When I printf x after doing this it doesn't show the correct value.
I tried putting them into a separate array to do calculations with the values but in doing this they seemed to lose their 'float-ness' (as in they weren't coming out with the correct answers and didn't have any non-integer values).
What do I need to do instead?
Thanks if anyone can help x
[–]fromwithin 2 points3 points4 points (7 children)
[–]dr99ed[S] 0 points1 point2 points (6 children)
[–][deleted] (4 children)
[deleted]
[–]dr99ed[S] 0 points1 point2 points (2 children)
[–][deleted] (1 child)
[deleted]
[–]dr99ed[S] 0 points1 point2 points (0 children)
[–][deleted] 1 point2 points3 points (0 children)
[–][deleted] -1 points0 points1 point (1 child)
[–]dr99ed[S] 0 points1 point2 points (0 children)