class DateCt
{
private:
string date;
char* ch;
public:
DateCt(char*);
string operator++();
void putOut()
{
cout<<date<<endl;
}
};
DateCt::DateCt(char* m_c)
{
date = m_c;
ch = "";
}
string DateCt::operator++()
{
char tmp[20];
int i_tmp = atoi(date.c_str())+1;
sprintf(tmp,"%d",i_tmp);
date = tmp;
return date;
}
int main()
{
DateCt ct("20120505");// 06 ,07
ct++;
ct.putOut();
return 0;
}
日期增减
最新推荐文章于 2023-01-10 18:32:21 发布