请问各位我的这个关于类的程序错在哪?
请问各位我的这个关于类的程序错在哪?#include<iostream.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;
}
void main()
{
Date date1,date2;
cout<<"date1 set and output:"<<endl;
date1.setDate(1998.4.28);
date1.showDate();//ues the showDate
cout<<"Date2 set and output:"<<endl;
date2.setDate(2002.11.14);
date2.showDate();
}
谢谢!