[求助]c语言调试问题?
我是新手,请问是什么错误呀???????#include<stdio.h>
#include<math.h>
float re(float u,float d)
{
float re;
re=1000*u*d/15.6;
return (re);
}
float h(float d,float k,float u,float l)
{
float r=0.027,x,h,a,y,z,m=0.318257,n=0.631779;
x=re(u,d);
if(x>2300)
{
a=d/l;
y=pow(a,m);
z=pow(x,n);
h=0.226421*r*y*z/d;
}
else
a=d/l;
y=pow(a,0.46642);
z=pow(x,0.453158);
h=0.866633*0.0283*y*z/d;
return(h);
}
float t(int n,float l,float d,float e,float k,float u,float ui,float iu,float ts,float t,float tf)
{
int i,m;
float p1=1.17,cp1=1.005,p2=8070,cp2=436,x,qv,a,v;
x=h(d,k,u,l);
a=n*l*k;
v=n*l*k*e;
qv=ui*iu/v;
for(m=0;m<101;m++)
{
for(i=0;i<11;i++)
tf=qv*ts/100*k/10/(u*ts/100-k/10)/(p1*cp1)-tf;
}
t=tf+ui*iu/(x*a)-(tf-t+ui*iu/x/a)*exp(-ts/p2/cp2);
return(t);
}
void main()
{
float u,d,k,ts,t,tf,n,l,e,ui,iu,y;
printf("input u,d,k,ts,t,tf,n,l,e,ui,iu:\n");
scanf("%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f",&u,&d,&k,&ts,&t,&tf,&n,&l,&e,&ui,&iu,&y);
y=t(n,l,d,e,k,u,ui,iu,ts,t,tf);
printf("the result is t=%f/n",y);
}
error C2064: term does not evaluate to a function
这一行错了,不知道怎么回事,
y=t(n,l,d,e,k,u,ui,iu,ts,t,tf);
----------------解决方案--------------------------------------------------------
以下是引用8o8w在2006-8-6 10:18:26的发言:
我是新手,请问是什么错误呀???????
#include<stdio.h>
#include<math.h>
float re(float u,float d)
{
float re;
re=1000*u*d/15.6;
return (re);
}
float h(float d,float k,float u,float l)
{
float r=0.027,x,h,a,y,z,m=0.318257,n=0.631779;
x=re(u,d);
if(x>2300)
{
a=d/l;
y=pow(a,m);
z=pow(x,n);
h=0.226421*r*y*z/d;
}
else
a=d/l;
y=pow(a,0.46642);
z=pow(x,0.453158);
h=0.866633*0.0283*y*z/d;
return(h);
}
float t(int n,float l,float d,float e,float k,float u,float ui,float iu,float ts,float t,float tf) //要改一下
{
int i,m;
float p1=1.17,cp1=1.005,p2=8070,cp2=436,x,qv,a,v;
x=h(d,k,u,l);
a=n*l*k;
v=n*l*k*e;
qv=ui*iu/v;
for(m=0;m<101;m++)
{
for(i=0;i<11;i++)
tf=qv*ts/100*k/10/(u*ts/100-k/10)/(p1*cp1)-tf;
}
t=tf+ui*iu/(x*a)-(tf-t+ui*iu/x/a)*exp(-ts/p2/cp2);
return(t);
}
void main()
{
float u,d,k,ts,t,tf,n,l,e,ui,iu,y;
printf("input u,d,k,ts,t,tf,n,l,e,ui,iu:\n");
scanf("%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f",&u,&d,&k,&ts,&t,&tf,&n,&l,&e,&ui,&iu,&y);
y=t(n,l,d,e,k,u,ui,iu,ts,t,tf); /*程序执行到这,并不能调用上面你写的那些函数,你上面所写的全部调用函数都没有
执行,因为你把t在上面定义成了一个float型变量,程序并不能就认为是调用上面你写的函数t.程序只会认为term does not evaluate to a function,不能成功把你写的t(n,l,d,e,k,u,ui,iu,ts,t,tf);这个组返回一个值.只要把上面的调用函数的名字改成其他名字如good什么的就可以了,当然主函数也要改成相同的名字.*/
printf("the result is t=%f/n",y);
}
error C2064: term does not evaluate to a function
这一行错了,不知道怎么回事,
y=t(n,l,d,e,k,u,ui,iu,ts,t,tf);
我是新手,请问是什么错误呀???????
#include<stdio.h>
#include<math.h>
float re(float u,float d)
{
float re;
re=1000*u*d/15.6;
return (re);
}
float h(float d,float k,float u,float l)
{
float r=0.027,x,h,a,y,z,m=0.318257,n=0.631779;
x=re(u,d);
if(x>2300)
{
a=d/l;
y=pow(a,m);
z=pow(x,n);
h=0.226421*r*y*z/d;
}
else
a=d/l;
y=pow(a,0.46642);
z=pow(x,0.453158);
h=0.866633*0.0283*y*z/d;
return(h);
}
float t(int n,float l,float d,float e,float k,float u,float ui,float iu,float ts,float t,float tf) //要改一下
{
int i,m;
float p1=1.17,cp1=1.005,p2=8070,cp2=436,x,qv,a,v;
x=h(d,k,u,l);
a=n*l*k;
v=n*l*k*e;
qv=ui*iu/v;
for(m=0;m<101;m++)
{
for(i=0;i<11;i++)
tf=qv*ts/100*k/10/(u*ts/100-k/10)/(p1*cp1)-tf;
}
t=tf+ui*iu/(x*a)-(tf-t+ui*iu/x/a)*exp(-ts/p2/cp2);
return(t);
}
void main()
{
float u,d,k,ts,t,tf,n,l,e,ui,iu,y;
printf("input u,d,k,ts,t,tf,n,l,e,ui,iu:\n");
scanf("%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f",&u,&d,&k,&ts,&t,&tf,&n,&l,&e,&ui,&iu,&y);
y=t(n,l,d,e,k,u,ui,iu,ts,t,tf); /*程序执行到这,并不能调用上面你写的那些函数,你上面所写的全部调用函数都没有
执行,因为你把t在上面定义成了一个float型变量,程序并不能就认为是调用上面你写的函数t.程序只会认为term does not evaluate to a function,不能成功把你写的t(n,l,d,e,k,u,ui,iu,ts,t,tf);这个组返回一个值.只要把上面的调用函数的名字改成其他名字如good什么的就可以了,当然主函数也要改成相同的名字.*/
printf("the result is t=%f/n",y);
}
error C2064: term does not evaluate to a function
这一行错了,不知道怎么回事,
y=t(n,l,d,e,k,u,ui,iu,ts,t,tf);
首先我要说一下你的程序中的几个缺点,函数的形参和实参不必是相同的;数据类型很多都不想匹配其中有double 到float的还有其他很多,不容易发现.其中对命名的不规范是造成出现一个error的原因.
----------------解决方案--------------------------------------------------------
谢谢!
----------------解决方案--------------------------------------------------------