哪位高手帮忙找找错,以下程序错在什么地方.实在是解决不了了.
#include<iomanip.h>
#include<string.h>
class Date{
short year;
short month;
short day;
public:
Date();
Date(int y,int m,int d):year(y),month(m),day(d){}
void show(){cout<<year<<'.'<<month<<'.'<<day;}
};
class Staff{
char staffNo[5];
char name[10];
char sex;
Date birthDay;
public:
Staff();
Staff(const char st-no[],const char st-name[],char st-sex,const Date &st-date):birthDay(st-date),sex(st-sex)
{ strncpy(staffNo,st-no,4);
strncpy(name,st-name,9);
}
void show()
{
cout<<endl<<setw(5)<<staffNo
<<setw(10)<<name
<<setw(3)<<sex;
birthDay.show();
}};
Date::Date()
{
cout<<endl<<"请输入年月日:";
cin>>year>>month>>day;
cin.ignore(80,'\n');
}
Staff::Staff()
{cout.setf(ios::left,ios::adjustfield);
cout<<endl<<"请输入职工号:";
cin.getline(staffNo,5);
cin.ignore(80,'\n');
cout<<endl<<"请输入姓名:";
cin.getline(name,10);
cin.ignore(80,'\n');
cout<<endl<<"请输入性别:";
cin>>sex;
cin.ignore(80,'\n');}
void main()
{Staff ss[4];
for(int i=0;i<4;i++)ss[i].show();}