帮我看下那里出错了,不能运行
#include<iostream.h>
double findmax(const double *pnumber,const int count){
double max=pnumber[0];
for(int i=0;i<count;i++)
{
if(max<pnumber[i])
{
max=pnumber[i];
}
}
return max;
}
double maximum(const double *pnumbers,const int count,double (*findmax)(const double *,const int)){
{
return findmax(pnumbers,count);
}
int main()
{
double numbers[]={12343.6,98938.4,12345.6,2485.33,95434.4};
int count=sizeof(numbers) / sizeof(double);
cout<<"the items in the array:"<<"\n";
for(int i=0;i<count;i++)
{
cout<<numbers[i]<<endl;
}
double maxvalue=maximum(numbers,count,findmax);
cout<<"the max value int the array is:"<<maxvalue<<endl;
return 1;
}
Compiling...
StdAfx.cpp
Compiling...
hyhyh.cpp
f:\hyhyh\hyhyh.cpp(19) : error C2601: 'main' : local function definitions are illegal
f:\hyhyh\hyhyh.cpp(32) : fatal error C1004: unexpected end of file found
执行 cl.exe 时出错.
hyhyh.exe - 1 error(s), 0 warning(s)
double findmax(const double *pnumber,const int count){
double max=pnumber[0];
for(int i=0;i<count;i++)
{
if(max<pnumber[i])
{
max=pnumber[i];
}
}
return max;
}
double maximum(const double *pnumbers,const int count,double (*findmax)(const double *,const int)){
{
return findmax(pnumbers,count);
}
int main()
{
double numbers[]={12343.6,98938.4,12345.6,2485.33,95434.4};
int count=sizeof(numbers) / sizeof(double);
cout<<"the items in the array:"<<"\n";
for(int i=0;i<count;i++)
{
cout<<numbers[i]<<endl;
}
double maxvalue=maximum(numbers,count,findmax);
cout<<"the max value int the array is:"<<maxvalue<<endl;
return 1;
}
Compiling...
StdAfx.cpp
Compiling...
hyhyh.cpp
f:\hyhyh\hyhyh.cpp(19) : error C2601: 'main' : local function definitions are illegal
f:\hyhyh\hyhyh.cpp(32) : fatal error C1004: unexpected end of file found
执行 cl.exe 时出错.
hyhyh.exe - 1 error(s), 0 warning(s)
...全文
相关推荐
游戏运行出错原因游戏运行出错原因及解决方案.txt
游戏运行出错原因及解决方案游戏运行出错原因及解决方案.游戏运行出错原因及解决方案.
解决pycharm运行出错,代码正确结果不显示的问题
今天小编就为大家分享一篇解决pycharm运行出错,代码正确结果不显示的问题,具有很好的参考价值,希望对大家有所帮助。一起跟随小编过来看看吧
微信小程序 合法域名校验出错详解及解决办法
微信小程序 合法域名校验出错详解及解决办法 看下出现错误: 微信小程序开发,遇到这个问题怎么办? 产生原因是因为发起了wx.request请求 而请求的域名没有在微信公众平台后台设置。 1.开发者自己手动设置不检验 不管你有没有拿到App ID ,我相信很多人都会和我一样做一件事,就是二话不说先大概了解下文档,然后直接上github找项目,导入试试。我是这么做的,结果上来就报这个错,后来发现其实可以自己设置本地开发工具不校验域名,完全没有影响。 在“项目”》最后一个选项,勾选之后运行就好了。 2.管理员设置实际项目域名 如果是实际项目开发,那就需要管理员先设置好咯。 设置步骤
c++程序运行出错问题处理
可以解决c++某些程序运行出错的问题 可以解决c++某些程序运行出错的问题 可以解决c++某些程序运行出错的问题 可以解决c++某些程序运行出错的问题
java程序代码不能运行的几个基本原因
在开发java时经常会出现以下错误,而开发工具本身世检查不出来的!在这有几个可能的原因



