The function is summing the result of multiplying each item in the buff
array with the item in the In
array at the same index.
For example, if buff was:
1.02
2.22
and In was:
3.43
6.55
and len was 2, the answer would be:
(1.02 * 3.43) + (2.22 * 6.55)
Now to explain what each parameter is.
float *buff
will contain an address to the start of an area of memory. That memory can be considered to contain zero or more float
values.
const float *In
will contain an address to the start of an area of memory. That memory can also be considered to contain zero or more float
values.
float *Pt
will contain an address to the start of an area of memory. In this case, it is expected that this will point to one float
value that the method is supposed to save the answer to.
In general, a pointer can:
- be null - also refered to as a 'null pointer' (and therefore not point to any memory)
- be a value that points at a single memory location to store one item
- be a value that points at the start of an area or memory to store more than one item
- be a value that points at an invalid memory location and should not be used
In this case, both buff
and In
point to the start of an area of memory containing a number of float
values (hopefully at least as many as len
specifies). Pt
points to the start of an area of memory that has been allocated so that the function can provide the result of the calculation to the caller.