这个错误不明白,请指教
程序代码如下:#include<iostream.h>
#include<stdlib.h>
class Date{
public:
void setDate(int y,int m,int d);
void showDate();
private:
int year;
int month;
int day;
};
void Date::setDate(int y,int m,int d)
{
year=y;
month=m;
day=d;
}
inline void Date::showDate()
{
cout<<year<<"."<<month<<"."<<day<<endl;
}
int main()
{
Date date1,date2,*date3;
cout<<"Date1 set and output:"<<endl;
date1.setDate(1998,4,28);
date1.showDate();
cout<<"Date2 set and output:"<<endl;
date2.setDate(2002,11,14);
date2.showDate();
cout<<"Date3 set and output:"<<endl;
date3->setDate(1998,10,25);
date3->showDate();
system("pause");
}
程序命名为“类和对象”运行后出现下面这个对话框:
哪里出错了啊?请高手指教