c - passing pointers to a function

前端 未结 3 2063
忘了有多久
忘了有多久 2020-12-11 21:44

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

3条回答
  •  我在风中等你
    2020-12-11 22:16

    Your function should be

    int min_max(double ** min , double ** max , int size , double a[]);
    

    and the calling statement should be

    int *min,*max;
    min_max(&min,&max,...);
    

提交回复
热议问题