class CDate{
public:
void SetYear(int year){year_ = year;}
void SetMonth(int month){month_ = month;}
void SetDay(int day){day_ = day;}
CDate& operator++(){
++this->day_;
return *this;
}
CDate& operator++(int){
this->day_++;
return *this;
}
private:
int year_;
int month_;
int day_;
};
追é®è½åä¸ä¸æºç¨åºå
追çä¸é¢åçå°±æ¯ä½ è¦çç±»å
追é®å(~_~;)
æ±æºç¨åºããã
追çä½ èªå·±ååä¸ä¸ªmainå½æ°è°ç¨ä¸ä¸å°±å®äºå
追é®😬😬😬😬😬
追ç#include <iostream>
using namespace std;
int main()
{
CDate date;
date.SetYear(2017);
date.SetMonth(3);
date.SetDay(23);
cout << date << endl;//å¨CDateç±»ä¸éè½½è¾åº
date++;
cout << date << endl;
return 0;
}