error C2447: “{”: 缺少函数标题(是否是老式的形式表?)求大神解答
#include "stdafx.h"
#include <stdlib.h>
#include <iostream>
using namespace std;
int getMaxOrMin(int*arr,int count,bool isMax)
{
int temp = arr[0];
for(int i = 1;i<count;i++)
{
if(isMax)
{
if(temp<arr[i])
{
temp= arr[i];
}
}
else
{
if (temp>arr[i])
{
temp =arr[1];
}
}
}
return temp;
}
int main(void);
{
int arr1[4]={3,5,1,7};
bool isMax =false;
cin >> isMax;
cout << "getMaxOrMin(arr1,4,isMax)" <<endl;
system("pause");
return 0;
}