单选题
有以下程序:
#include<stdio.h>
#include<stdlib.h>
void fun(double*p1,double*p2,double*s)
{s=(double*)calloc(1,sizeof( double));
*s=*p1+*(p2+1);
}
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);
}
程序运行后的输出结果是______。
【正确答案】
D
【答案解析】[解析] 本题考查把数组名作为函数参数,执行fun函数后,s的值并没有发生变化,仍然是指向a,所以输出结果为1.10,选项D正确。