帮我看下那里出错了,不能运行
#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)