请大家帮忙看看!谢谢!
#include<iostream>using namespace std;
class date
{
public:
date(int year=1900,int month=1,int day=1) {Xyear=year; Xmonth=month; Xday=day;}
date(date &p);
int GetYear() {return Xyear;}
int Getmonth() {return Xmonth;}
int Getday() {return Xday;}
void showdate();
private:
int Xyear,Xmonth,Xday;
};
date::date(date &p)
{
Xyear=p.Xyear;
Xmonth=p.Xmonth;
Xday=p.Xday;
}
inline void date::showdate()
{
cout<<"出生日期:"<<Xyear<<"年"<<Xmonth<<"月"<<Xday<<"日"<<endl;
}
class people
{
public:
people(int no,char sex,date birthday,int id);
people(people &);
~people();
void showpeople();
private:
int No,Id;
char Sex;
date Birthday;
};
people::people(int no,char sex,date birthday,int id):Birthday(birthday)
{
int No=no;
char Sex=sex;
int Id=id;
}
people::people(people &) {}
people::~people() {}
inline void people::showpeople()
{
cout<<"编号为:"<<No<<"性别为:"<<Sex<<"出生日期为:"<<endl;
Birthday.showdate();
cout<<"身份证为:"<<Id<<endl;
}
void main()
{
date aa(1986,5,24);
int no,id,year,month,day;
char sex;
people bb(no,sex,aa,id);
cout<<"请分别输入编号,性别,出生日期和身份证号码:"<<endl;
cout<<"请输入编号:"<<endl;
cin>>no;
cout<<"请输入性别:"<<endl;
cin>>sex;
cout<<"请输入年份:"<<endl;
cin>>year;
aa.GetYear();
cout<<"请输入月份:"<<endl;
cin>>month;
aa.Getmonth();
cout<<"请输入日:"<<endl;
cin>>day;
aa.Getday();
cout<<"请输入ID:"<<endl;
cin>>id;
cout<<"我的信息是:"<<endl;
bb.showpeople();
}
程序编译没有问题
但是在运行后会出现这个问题
Loaded 'ntdll.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\kernel32.dll', no matching symbolic information found.
The thread 0xC74 has exited with code -858993460 (0xCCCCCCCC).
The program 'E:\C++\c++试验记录\2008-10-8\lch\Debug\lch.exe' has exited with code -858993460 (0xCCCCCCCC).
请大家帮忙看看
谢谢了!