++i和i++的区别 ++i先自增1,再返回,i++先返回i,再自增1 ++i和i++的实现 ++i 实现: int& int::operator++() { *this +=1; return *this; } i++ 实现: const int int::operator(int) { int oldValue = *this; ++(*this); return oldValue; }