Home > Back-end >  Always unexpected 'class People (', and the interpretation of the online comparison, howev
Always unexpected 'class People (', and the interpretation of the online comparison, howev

Time:10-24

//Date. H
# # ifndef DATE_H
# define DATE_H
The class Date {
Protected:
int year;
Int the month;
Int day;
Public:
The Date (int yearv, int monthv, int dayv);
The Date (const Date & amp; The date);
Void Init (int yearv, int monthv, int dayv);
Void Init (const Date & amp; The date);
void show();
};

# endif

# include "Date. H"
# include
using namespace std;
Date: the Date (int yearv, int monthv, int dayv)
{
Year=yearv;
The month=monthv;
Day=dayv;
}

Date: the Date (const Date & amp; The date)
{
Year=date. The year;
The month=date. The month;
Day=date. Day;
}

Void Date: : Init (int yearv, int monthv, int dayv)
{
Year=yearv;
The month=monthv;
Day=dayv;
}

Void Date: : Init (const Date & amp; The date)
{
Year=date. The year;
The month=date. The month;
Day=date. Day;
}


Void Date: : show ()
{
cout<" Date of birth "& lt; <" \ t "& lt; }

//People. H
# # ifndef PEOPLE_H
# define PEOPLE_H
# include "Date. H"
# include
The class People {
Public:
People (long, string name, string sex, string ident_no, int year, int the month, int day);
People (long, string name, string sex, string ident_no, Date Date);
People (const People & amp; P);
Void Init (long, string name, string sex, string ident_no, int year, int the month, int day);
Void Init (long, string name, string sex, string ident_no, Date Date);
Void Init (const People & amp; P);
Void the show () the const;
Protected:
The Date m_date;
Long m_no;
String m_ident_no;
String m_name;
String m_sex;
};

# endif


# include "People. H"
# include "Date. H"
# include
# include
using namespace std;
People: People (long, string name, string sex, string ident_no, int year, int the month, int day: m_date (year, month, day)
{
M_no=no.
M_name=name;
M_sex=sex;
M_ident_no=ident_no;
}


People: People (long, string name, string sex, string ident_no, Date Date) : m_date (Date)
{
M_no=no.
M_name=name;
M_sex=sex;
M_ident_no=ident_no;
}

People: People (const People & amp; P) : m_date (date)
{
M_no=p. _no;
M_name=p. _name;
M_sex=p. _sex;
M_ident_no=p. _ident_no;
}


Void People: : Init (long, string name, string sex, string ident_no, int year, int the month, int day
{
M_date. Init (year, month, day);
M_no=no.
M_name=name;
M_sex=sex;
M_ident_no=ident_no;
}

Void People: : Init (long, string name, string sex, string ident_no, Date Date)
{
M_date=date;
M_no=no.
M_name=name;
M_sex=sex;
M_ident_no=ident_no;
}

Void People: : Init (const People & amp; P)
{
M_date=p. _date;
M_no=p. _no;
M_name=p. _name;
M_sex=p. _sex;
M_ident_no=p. _ident_no;
}

Void People: : show () const
{
cout<" The name "& lt; <" \ t "& lt; cout<" No. "& lt; <" \ t "& lt; cout<" Gender "& lt; <" \ t "& lt; cout<" Id "& lt; <" \ t "& lt; M_date. The show ();
}



CodePudding user response:

//the main CPP
# include "People. H"
# include "Date. H"
Void main ()
{
People p (231, "dhfioer", "HFK", "really", 234,3,87);
P. how ();
}
  • Related