静态成员函数为什么不能调用静态数组呢????
#include <iostream>using namespace std;
class Event{
private:
int day;
int month;
static int year;
static int m[13];
public:
int getDay(){return day;}
int getMonth(){return month;}
void setDay(int d){day = d;}
void setMonth(int m){month = m;}
void setYear(int y){ year = y;}
int getYear(){return year;}
int operator-(Event & e);
static void setM();
};
void Event::setM(){
int i,j;
for(i = 1,j = 12;i < j;i++,j--){
if(i%2)
m[i] = m[j] =31;
else
m[i] = m[j] =30;
}
m[7] = 31;
if(year % 4)
m[2] = 29;
else
m[2] = 28;
}
int Event::operator-(Event & e){
Event::setM();
}
int main()
{
return 0;
}