程序错误
error吧
全部回复
仅看楼主
level 1
error C2676: binary '==' : 'class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >' does not define this operator or a conversion to a type acceptable to the predefined operator
是什么意思,急求解答!!!
程序部分
employee* employee::State(employee* Head) //统计数据
{
employee* ptr;
ptr=Head->Next;
string sex,cemployee;
sex=ptr->m_Sex;
cemployee=ptr->m_Cemployee;
float i=0,j=0,k=0;
float s;float a,b,c;
extern n;
do
{
s=ptr->m_Wage+s;
if(sex==M)i++;//男职工人数
if(ptr->m_Year!=0)j=j+2014-ptr->m_Year;//年龄和
if(cemployee==Y)k=k+1;//在岗职工数
a=(i/n);
b=1-(i/n);
c=(k/n);
ptr=ptr->Next;
}while(ptr!=Null);
cout<<endl<<" ~~~~~~~~~~~~~~~~~~~~统计结果~~~~~~~~~~~~~~~~~~~~~~"<<endl;
cout<<" 职工总数:"<<n<<endl;
cout<<" 职工的平均工资:"<<s/n<<"\t\t职工总工资:"<<s<<endl;
cout<<" 男职工比例:"<<a<<"\t\t女职工比例:"<<b<<endl;
cout<<" 职工的平均年龄:"<<j/n<<endl;
cout<<" 职工的在岗人数比例:"<<c<<endl;
return Head;
}
2014年07月03日 12点07分 1
1