求解一个关于C++的const的使用,编译时显示[Error] 'MAXSIZE does not name a type
#include<iostream>
#include<iomanip>
using namespace std;
const MAXSIZE=20;
int sort(int list[],int size);
int main()
{
static int list[MAXSIZE];
int size=0;
do
{
cout<<"Type number<-999 to exit>: ";
cin>>list[size];
}
while(list[size++]!=-999);
sort(list,size-1);
cout<<"After sorting....\n";
for(int dex=0;dex<size-1;dex++)
cout<<setw(5)<<list[dex];
}
int sort(int list[],int size)
{
int x
for(int y=0;y<size-1;y++)
for(x=y+1;x<size;x++)
if(list[y]>list[x])
{
int temp=list[y];
list[x]=list[y];
list[y]=temp;
}
}