i am trying to run the following program and i keep getting a compiling error that says that foo is not a function. What am I doing wrong?
Code:#include <stdio.h> #include <stdlib.h> double* makeAnArray(double size); int main (void) { double *anArray; int size=0; int i; double *foo; printf("Please enter the size of the array "); scanf("%d", &size); anArray=makeAnArray(size); for (i = 0; i < size; i++) { printf("%.1f ", anArray[i]); } printf("\n"); foo(anArray,size); free(anArray); getchar(); return 0; } double* makeAnArray(double size){ double* array; array =calloc(size,sizeof(double)); return array; } void foo (double* a, double size){ int i; for (i=0; i<size; i++){ *(a+i)=132; } }



LinkBack URL
About LinkBacks


