I have a number of functions that have the following form:
typedef float arr3[3];
float newDistanceToLine(arr3 &p0, arr3 &p1, arr3 &p2);
and now find convenient to store lots of points into a long array:
int n_points = 14;
float *points;
points = new float[3*n_points];
Is there a way to pass pointers to different values of the array "points" to my functions accepting fixed size arrays? I know that the following fails, but, I would like to do something like:
newDistanceToLine(&points[3], &points[6], &points[9]);
or get any help on how best to reuse my code.
Thanks!