用Vc++编译下面程序时,提示错误是 Error C2064: Term Does Not Evaluate To A Function
#Include <Stdio.H>
#Include <Stdlib.H>
Main()
{
Float Average();
Float A,B,C,Ave;
Scanf("%F,%F,%F
",&A,&B,&C);
Ave=Average(A,B,C);
}
Float Average(Float X,Float Y,Float Z)
{
Float Aver;
Aver=(X+Y+Z)/3;
Return(Aver);
}
原因分析:
写成:
Void Main()
{
Float Average(Float X,Float Y,Float Z);
Float A,B,C,Ave;
Scanf("%F,%F,%F",&A,&B,&C);
Ave=Average(A,B,C);
Printf("%F
",Ave);
} |