[求助]++a++与(++a)++
++a++这样不行,为什么(++a)++ 行呢?谢谢.
1. a++ returns a const obj
++a returns a reference.
see the following code --- how to overload ++ and -- in C++.
2. ++a++ does not work since your complier interprets it as
++( (a++) )
Since a++ is a const obj, say b, ++b must not be allowed;
仁兄的意思是++a 返回的变量,a++返回的是常量是不,但为什么会有这种区别的,两者都是自增运算符,为什么会有这种区别?