求助,这个程序哪里错了??
#include<iostream>#include<cstdlib>
using namespace std;
class date
{
private:
int year;
int month;
int day;
public:
date(int y,int m,int d)
{
cout<<"构造date"<<endl;
}
inline void copy(int y,int m,int d)
{
year=y;
month=m;
day=d;
}
inline void print2()
{
cout<<year<<"."<<month<<"."<<day<<endl;
}
~date()
{
}
};
class people
{
private:
long int number;
char sex;
char id[20];
int y,m,d;
public:
date b1(0,0,0);
people()
{
number=0;sex='\0';
y=m=d=0;
}
inline void xinxi()
{
cout<<"please input the number:";
cin>>number;
cout<<"please input the sex:(m/f)";
cin>>sex;
cout<<"please input the id:";
cin>>id;
}
inline void birth()
{
cout<<"the birthday"<<endl;
cout<<"please input the year:";
cin>>y;
cout<<"please input the month:";
cin>>m;
cout<<"please input the day:";
cin>>d;
b1.copy(y,m,d);
}
inline void print1()
{
cout<<number<<endl
<<sex<<endl
<<id<<endl;
b1.print2();
}
~people()
{
}
};
int main()
{
int i,n;
system("color 9e");
people p1[1000];
cout<<"How many people?";
cin>>n;
for(i=0;i<n;i++)
{
p1[i].xinxi();
p1[i].birth();
}
for(i=0;i<n;i++)
{
p1[i].print1();
}
return 0;
}
哪里错了呢??