Hi, I've been trying to sort this out all day, and it's driving me crazy because I'm pretty sure its just a matter of straightening out the functions and pointers, but I can't make anything work.

I need to calculate the sum of the first 20 Fibonacci numbers with the fibonacci numbers stored in an array. This is where I'm at, any help would be very much appreciated. Thanks!

Code:#include <stdio.h> int arraySum(int *array, const int n) { int sum = 0; int * const arrayEnd = array + n; for ( ; array < arrayEnd; ++array ) sum +=*array; return sum; } int main(void) { int arraySum (int *array, const int n); int i, numFibs= 20; int fibonacci[numFibs]; fibonacci[0] = 0; fibonacci[1] = 1; for (i = 2; i < numFibs; ++i) fibonacci[i] = fibonacci[i-2] + fibonacci[i-1]; printf("Their sum is %i\n ", arraySum (fibonacci, 20) ); return 0; }