我正在使用旧软件 TurboC++ 4.5(1995) 进行编译,但遇到了一些错误。任何人都可以帮忙吗?
#include<iostream.h>
#include<math.h>
void cal_root(int,int,int,float&,float&);
void main()
{
float root1=0,root2=0;
int a,b,c;
cout<<"Enter the three co-efficients of quadratic equation with spaces.\n";
cin>>a>>b>>c;
cal_root(a,b,c,root1,root2);
cout<<"The roots for given Quadratic Equation are "<<root1<<" & "<<root2<<".";
}
void cal_root(int a,int b,int c,float& root1,float& root2)
{
root1=-b+(sqrt((b*b)-4ac))/(2a); //error here
root2=-b-(sqrt((b*b)-4ac))/(2a); //error here
}
我收到以下错误:
Function call missing ) in function cal_root(int, int, int, float&, float &)
在第 16 和 17 行