编译出现错误,求大神讲解error: functional cast expression list treated as compound expressio
编译出现错误,求大神讲解error: functional cast expression list treated as compound expression
函数实现功能:输入员工的姓名,出生日期(月/日),按日期大小输出员工姓名
#include<iostream>
using namespace std;
struct Employ{
string a;
int mouth;
int day;
};
void sort(Employ e[],int n)
{
Employ temp;
for(int i=0;i<n;i++)
{ temp.a=e.a;
temp.mouth=e.mouth;
temp.day=e.day;
for(int j=i+1;j<0;j++)
{
if(temp.mouth>e[j].mouth)
{temp.mouth=e[j].mouth;
temp.day=e[j].day;
temp.a=e[j].a;
}
if(temp.mouth==e[j].mouth){
if(temp.day>e[j].day)
{
temp.a=e[j].a;
temp.day=e[j].day;
}
}
}
cout<<temp.a<<temp.mouth<<temp.day<<endl;
}
}
int main()
{
int num;
cout<<"please intput the number of employ"<<endl;
cin>>num;
Employ e_num[num];
for(int i=0;i<num;i++)
{
cout<<"please input the name of "<<i+1<<" employ "<<endl;
cin>>e_num.a;
cout<<"please input the mouth of "<<i+1<<" employ (1-12)"<<endl;
cin>>e_num.mouth;
cout<<"please input the day of "<<i+1<<" employ (1-31)"<<endl;
cin>>e_num.day;
cout<<endl;
}
void(e_num,num);
return 0;
}