Help needed with pointing to arrays.
I'm trying to write a function that takes as input 3 arrays, does some calculations, puts some values into a global array, then returns a pointer to that array.
function is:
Code:
GLfloat calcNormal(GLfloat* B1, GLfloat* B2, GLfloat* T)
{
//calculations here.
return normArray[0];
}
If I define 3 arrays, A(0,0,0), B(1,0,0), and C(0,1,0), then call printf("%f\n", calcNormal(A[0], B[0], C[0])[2]), compiler says arguments are of wrong type. If I try passing &A[0], &B[0] and &CP[0], compiler says subscripted value is neither array nor pointer.
How should I be passing array pointers to the function?