若有以下函数首部int fun(double x[10], int *n)则下面针对此函数的函数声明语句中正确的是A)int fun(double x, int *n);B)int fun(doubl

7 查阅

若有以下函数首部

int fun(double x[10], int *n)

则下面针对此函数的函数声明语句中正确的是

A)int fun(double x, int *n);

B)int fun(double , int );

C)int fun(double *x, int n);

D)int fun(double *, int *);

参考答案:

D答案 D解析 : 函数首部 int fun(double x[10],int *n) 表示这个函数的返回值是整型,其第 1 个形式参数是一个双精度的一维数组,第 2 个参数是一个整型指针。在 C 语言中,一维数组的名字表示的是一维数组的地址,所以选项D是正确的。

计算机二级