调试出来为什么是1.1?
#include <stdio.h>#include <stdlib.h>
void fun(double *p1,double *p2,double *s)
{
s=(double *)calloc(1,sizeof(double));
*s=*p1+*(p2+1);
}
void main()
{
double a[2]={1.1,2.2},b[2]={10.0,20.0},*s=a;
fun(a,b,s);
printf("%5.2f\n",*s);
}
fun()函数中s明明是传址调用为什么值不变仍为1.1?