undeclared identifier#include<conio.h>
来源:百度知道 编辑:UC知道 时间:2024/06/03 17:53:21
#include<conio.h>
#include<stdio.h>
double fun(double q)
{
int n;
double s;
n=2;
s=2;
while(s<=q)
{
s=s+double (n+1)/n;
n++;
}
printf("n=%d\n",n);
return (s);
}
void main()
{
prinft("%f\n",fun(50));
}
估计是软件编译有问题吧,老是出现这种错误~~郁闷!!
加没加空格一样效果
#include<stdio.h>
double fun(double q)
{
int n;
double s;
n=2;
s=2;
while(s<=q)
{
s=s+double (n+1)/n;
n++;
}
printf("n=%d\n",n);
return (s);
}
void main()
{
prinft("%f\n",fun(50));
}
估计是软件编译有问题吧,老是出现这种错误~~郁闷!!
加没加空格一样效果
#include<conio.h>
#include<stdio.h>
double fun(double q)
{
int n;
double s;
n=2;
s=2;
while(s<=q)
{
s=s+double (n+1)/n; //强制类型转换,要加括号.(double)/
n++;
}
printf("n=%d\n",n);
return (s);
}
void main()
{
prinft("%f\n",fun(50)); //printf非prinft
}
#include<conio.h>
#include<stdio.h>
double fun(double q)
{
int n;
double s;
n=2;
s=2;
while(s<=q)
{
s=s+(double) (n+1)/n;
n++;
}
printf("n=%d\n",n);
return (s);
}
void main()
{
printf("%f\n",fun(50));
}
输出为:
n=47
50.416687
Press any key to continue
呃,请在包含文件#include后面空个格再写中括号呃。
你用的是什么开发环境?
除了最后一行那个prinft写错了
程序可以运行
我用的是vs2003
VC++6.0 (undeclared identifier)
为什么总是出现“undeclared identifier”?
'sqrt' : undeclared identifier
undeclared identifier怎么错了????
c++调试出现undeclared identifier
VC为什么总是undeclared identifier
Vc++疑问:'temp' : undeclared identifier
C++问题:'ptemp' : undeclared identifier
dephi问题:Undeclared identifier: 'Create'
请问这里的undeclared identifier是什么意思呢?