To pass an entire array to a function, just pass the array's name. This example shows a function that sets each element of an array to zero, a function that copies one array to another, and a function to add 2 arrays.
void initializeArray(int anArray[], int arraySize);
void copyArray(int target[], int source[], int size);
void addArrays(int a1[], int a2[], int a3[], int size);
// shows how to pass arrays, doesn't do anything else
void main(void)
{
int a[50], b[100], c[100], d[100];
initializeArray(a, 50); // set 50 elements to 0
initializeArray(b, 100); // set 100 elements to 0
copyArray(c, b, 100); // copy b to c
addArrays(b, c, d, 100); // add b,c and put in d
}
void initializeArray(int anArray[], int arraySize)
{
for (int i = 0; i < arraySize; i++)
anArray[i] = 0;
}
void copyArray(int target[], int source[], int size)
{
for (int i = 0; i < size; i++)
target[i] = source[i];
}
void addArrays(int a1[], int a2[], int a3[], int size);
{
for (int i = 0; i < size; i++)
a3[i] = a1[i] + a2[i];
}