why doesnt this need malloc
double change(int *a, int size) {
        double sum = 0.0;
        for(int i = 0; i < size; i++) {
                a[i] += 10;
                sum += a[i];
        }
        return sum / size; // assume size > 0
}
int main() {
        int arr[3] = {1, 2, 3};
        double result = change(arr, 3);
        // Comment the above, and uncomment the below, to see
        // change only work on the 2nd and 3rd integers
        // double result = change(arr + 1, 2);
        printf("The array is now: ");
        for(int i = 0; i < 3; i++) {
                printf("%d ", arr[i]);
        }
        printf("\nAnd the average is %lf\n", result);
        return 0;
}