c++习题 10.下列函数定义中正确的是( ).请解析一下每个选项.还有正确答案A.double fun(double &x,double &y) B.double fun(double &x,double &y){ {double z; return *x/*y;z=x/y; }return z;}C.double fun(double *x,double *y) D.double
来源:学生作业帮助网 编辑:六六作业网 时间:2025/01/31 17:51:51
c++习题 10.下列函数定义中正确的是( ).请解析一下每个选项.还有正确答案A.double fun(double &x,double &y) B.double fun(double &x,double &y){ {double z; return *x/*y;z=x/y; }return z;}C.double fun(double *x,double *y) D.double
c++习题 10.下列函数定义中正确的是( ).请解析一下每个选项.还有正确答案
A.double fun(double &x,double &y) B.double fun(double &x,double &y)
{ {
double z; return *x/*y;
z=x/y; }
return z;
}
C.double fun(double *x,double *y) D.double fun(double *x,double *y)
{double z; { double z;
z=x/y; z=&x/&y;
return z; return z;
} }
c++习题 10.下列函数定义中正确的是( ).请解析一下每个选项.还有正确答案A.double fun(double &x,double &y) B.double fun(double &x,double &y){ {double z; return *x/*y;z=x/y; }return z;}C.double fun(double *x,double *y) D.double
必须是A啊.
B的改为return x/y就是对的
C的改为z=*x/*y就是对的
D改法与C是一样的