Code:
float *It1, *It2, *It3;
It1 = I1[];
It2 = I2[];
It3 = I3[];
It1 holds the address of the first element of I1, thus (It1 + 1) is the address of the second, etc. Therefore, *It1 = the value of the first element, *(It1 + 1) the value of the second element. Simple pointer arithmetic.
It makes more sense, and is more clear just to use the pointer notation rather than the array notation to begin with even though they mean the same thing (most of the time). That means you can use I1 like you use It1, making It1 useless.
You should also pass the size of array in, rather than using a magic '360' value.
Code:
#include <stdio.h>
float something(const float * one, const float * two, const float * three, size_t n);
int main(void)
{
float x[] = {5.0f, 10.0f, 3.0f};
printf("%d, %f\n", sizeof(x) / sizeof(*x), something(x, x, x, sizeof(x) / sizeof(*x)));
return 0;
}
float something(const float * one, const float * two, const float * three, size_t n)
{
size_t i = 0;
float acc = 0.0f;
/* make sure you check that one, two and three are not NULL!
* you can't dereference NULL pointers */
/* keep us in bound, going from [0,n) */
for(i = 0; i < n; ++i)
{
/* you could put this all on one line, but it's easier to read this way */
acc += *one + *two + *three;
++one; /* move the first array spot one right */
++two;
++three;
}
return acc;
}
Notice how I made the arguments constant, so I know the value of the array doesn't change.
Anyway, my post gives you all the details (yes they're all in there somewhere). You just have to fish!