大家能帮我看看这里为什么错了吗,谢谢
帮我指正一下,谢谢~~
#include<iostream.h>
#include<stdlib.h>
#include<iomanip.h>
int People1(int[],int);
void main()
{
const int number=10;
int TotalSalary[number]={2000,3000,5000,6540,8750,1250,5420,2450,9005,1500};
cout<<"\n\nSalary Range"<<setw(10)<<"Number"<<endl;
People1(TotalSalary,number);
}
int People1(int TotalSale,int size)
{
int
PersonSalary[10]={0},
frequence[10]={0};
for(int i=0;i<size;i++)
{
PersonSalary[i]=int(200+0.09*TotalSale[i])/100;//这里报错
++frequence[PersonSalary[i]];
cout<<100*(i+1)<<"~"<<"100*(i+2)"<<setw(10)<<frequence[PersonSalary[i]]<<"\n";
}
}
编辑器vc++6.0所报的错
Compiling...
AA.CPP
C:\Documents and Settings\Administrator\桌面\调试\AA.CPP(20) : error C2109: subscript requires array or pointer type
Error executing cl.exe.
AA.OBJ - 1 error(s), 0 warning(s)
[此贴子已经被作者于2006-6-7 15:24:42编辑过]