#include <stdio.h>
#include <math.h>
double sum(double *x, int N) {
int i ;
double total= 0;
for (i = 0 ; i < N; i++) {
total += x[i];
}
return total;
}
int main()
{
double (*stat)(double * , int);
stat = sum;
double a[] = {1, 2, 3};
double Sum;
Sum = stat(a, 3);
printf("sum = %f ", Sum);
return 0;
}
Pass An Array to a Pointer Function in CAttaullah Shah2021-12-18T13:16:38+05:00