我正在编译一个旧的软件TurboC++ 4.5(1995),我有一些错误。谁能帮忙?TurboC++编译时错误
#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
是否有任何理由,你是使用*这样的*旧的编译器?除非你有很好的理由,否则你只会给自己造成痛苦。 – Mankarse
我知道它的废话,但在我的学校,他们教这个... – user142187
如果你正在学习计算机科学,沟渠那所学校,如果你曾经想专业地使用C++ ......我认真......代码不会编译甚至在修正了'cal_root'中的错误之后。 – ApplePie