可看一博主文章http://blog.csdn.net/insistgogo/article/details/6626952
下面是自+1的函数重载
//单目运算符重装++, --
Person& operator++() //++a;
{
this->age += 1;
return *this;
}
Person operator++(int) //a++
{
Person old(*this);
this->age += 1;
return old;
}
原文:http://www.cnblogs.com/kirk1995/p/7229729.html