This should help you with your problem.
When you pass an array to a function, it decays to a pointer. A pointer is just something that points to a memory address. If you pass a pointer to a function, you are passing the memory address of that variable, so you can actually go to that memory address and modify it. So if you pass a pointer to a variable from our main function, and modify the data at that pointer in another function, the variable in our main function will be effected.
You declare arrays like this:
perhaps in your case.
Your array can contain five floats. That is, data through data. That does not include data.
You still, of course, need to do the "error checking" and whatnot for the function.
#define MAX 5
void input_array(float data); //function prototype
//Now we can access user-inputted data from main.. Ex:
printf("From main - data1 = %f\n", data1);
void input_array(float data)
printf("Please input your data one at a time\n");
for(i = 0; i < MAX; i++)
printf("Data piece %d: ", i);