请问划红线的语句为什么是错的?谢谢
#include <iostream>using namespace std;
class Date_song
{
public:
int Isleap();
void Print();
Date_song(int a ,int b ,int c );
~Date_song();
private:
int year;
int month;
int day;
};
Date_song::Date_song(int a ,int b , int c)
{
year = a;
month = b;
day = c ;
cout<<"构造函数被调用了么?"<<endl;
}
Date_song::~Date_song()
{
cout<<"析构函数被调用了吗?"<<endl;
}
int Date_song::Isleap()
{
int i = 0;
if (year%4==1)
i =1;
else
i = 0;
return i;
}
void Date_song::Print()
{
cout<<year<<"年"<<month<<"月"<<day<<"号"<<endl;
}
int main()
{
Date_song da[5];
Date_song Date1(2014,8,1) ,*pdate;
pdate = &Date1;
int j = 0 ;
j = pdate->Isleap();
pdate->Print();
cout<<j<<endl;
return 0 ;
}