I keep getting two errors and I don't know how to fix it. I am still getting my executable on the Unix server...I'm just confused. Line21 |
|
passing argument 2 of 'array_processing' makes integer from pointer without a cast [enabled by default] |
Line2 |
|
note: expected 'int' but argument is of type 'int *'
|
This is my code:
Code:
#include<stdio.h>
void array_processing (int x[],int size,int *min,int *max,float *mean)
{
int i,sum=0;
for(i=0;x[i]!=0;i++)
{
size = 23;
if(*min>x[i])
*min=x[i];
if(*max<x[i])
*max=x[i];
sum+=x[i];
}
*mean=sum*1.0/size;
}
int main(void)
{
int data_ar[23]={3,5,6,7,12,3,4,6,19,23,100,3,4,2,9,43,32,45,32,2,3,2,1};
int MIN[2]={210000},MAX[2]={0},SIZE[2]={0};
float MEAN[2]={0};
array_processing(data_ar,SIZE,MIN,MAX,MEAN);
printf("The min of the array is: %d\n", MIN[0]);
printf("The max of the array is: %d\n", MAX[0]);
printf("The mean of the array is: %f\n", MEAN[0]);
return (0);
}