Your temparray is exactly that. It's created within the local block of the function and destroyed when the function exits, unfortunately.
Pass in an array by pointer so that your function signature looks like
void arrayfunction(float arr[],float flt1,float flt2,float flt3)
{
//load up the array here
//still exists on exit
}
I suspect since you are using opengl that your function is really more complicated than this.
What you have above could work with some modifications, but I think the above way is much more straightforward.