请教各位大侠:一个构造函数是否允许包含不同类型的参数,如果允许的,又怎么定义这个构造函数?
#include <iostream>
using namespace std;
class Day
{
private:
int year,month,day;
public:
Day(int y,int m,int d)
{ year=y; month=m; day=d ; }
Day (Day &one)
{ year =one.year; month=one.month; day=one.day; }
void show()
{ cout<<year<<' '<<month<<' '<<day<<endl;}
};
class person
{
private:
int num,IDnum;
char sex;
Day birthday;
public:
person(int n,int IDn ,char s,Day &birthday);
};
int main()
{
return 0;
}