I'm trying to change where the pointers min and max are pointer to, but it seems that the "change" is not sticking outside the function's scope (after the function has run). Before running the function I set *min and *max to point to a "double m = 0". I'm kind of a NOOB so any advice would be appreciated.
int min_max(double * min , double * max , int size , double a[]){
int i;
printf("\n%lg\t%lg\n", *min, *max);
min = &a[0];
max = &a[0];
for (i = 1 ; i < size ; i++) {
if (a[i] > *max)
max = &a[i];
else if (a[i] < *min)
min = &a[i];
}
printf("\n%lg\t%lg\n", *min, *max);
return 0;
}