C++ intelliSense:没有重载函数的实例;sqrt";与参数列表匹配的参数类型有:(双*)

C++ intelliSense:没有重载函数的实例;sqrt";与参数列表匹配的参数类型有:(双*),c++,math.h,C++,Math.h,这个代码有什么问题??!!!我正在做一个程序,试图解决二次方程,看到这个错误,无法解决它我应该改为浮点还是什么 #include<stdio.h> #include<conio.h> #include<math.h> void solve_quadratic(double a,double b,double c ,double *d ,double *r1,double *r2); int main (void) { double x,y,z; double

这个代码有什么问题??!!!我正在做一个程序,试图解决二次方程,看到这个错误,无法解决它我应该改为浮点还是什么

#include<stdio.h>
#include<conio.h>
#include<math.h>

void solve_quadratic(double a,double b,double c ,double *d ,double *r1,double *r2);
int main (void)
{
double x,y,z;
double root1,root2;
double desc;
printf("Enter the value of a:  ");
scanf("%lf",&x);
printf("Enter the value of b :  ");
scanf("%lf",&y);
printf("Enter the value of c :   ");
scanf("%lf",&z);

solve_quadratic(x,y,z,&desc,&root1,&root2);
if (desc<0)
{
    printf("No Result !!!");
}
else if (desc>0)
{
    printf("The value of the first root = %f \n",root1);
    printf("The value of the second root = %f  \n",root2);
}
getch();
return 0;

}

void solve_quadratic(double a,double b,double c ,double *d ,double *r1,double *r2)
{
*d=b*b-4*a*c;
if (d>=0)
{
    *r1=(-b+sqrt(d))/(2*a);
    *r2=(-b-sqrt(d))/(2*a);
}
}
#包括
#包括
#包括
无效解_二次型(双a,双b,双c,双d,双r1,双r2);
内部主(空)
{
双x,y,z;
双根1,根2;
双描述;
printf(“输入a:”)的值;
扫描频率(“%lf”、&x);
printf(“输入b的值:”);
扫描频率(“%lf”、&y);
printf(“输入c的值:”);
扫描频率(“%lf”、&z);
求解_二次(x,y,z,&desc,&root1,&root2);
if(desc0)
{
printf(“第一个根的值=%f\n”,root1);
printf(“第二个根的值=%f\n”,root2);
}
getch();
返回0;
}
void solve_二次型(双a、双b、双c、双d、双r1、双r2)
{
*d=b*b-4*a*c;
如果(d>=0)
{
*r1=(-b+sqrt(d))/(2*a);
*r2=(-b-sqrt(d))/(2*a);
}
}

@TadrosEbrahim:答案告诉你该怎么做。使用
*d
double
本身,而不是
d
,作为指向它的指针。
*r1=(-b+sqrt(d))/(2*a);     <<<< d is pointer not double.
*r1=(-b+sqrt(*d))/(2*a);